Measuring Software Size SE-280 Dr. Mark L. Hornick 1

12 Slides342.00 KB

Measuring Software Size SE-280 Dr. Mark L. Hornick 1

We want to establish a historical Size-Effort Correlation for future planning purposes Actual Time (hrs) Is LOC a good measure of size? Yes, according to 20 years of research conducted by Humphrey 3.5 3 2.5 yk 2 1.5 1 0.5 0 0 50 100 xk 150 200 Actual Size (LOC) SE-280 Dr. Mark L. Hornick 2

But how should we count LOC? LOC types Logical lines of code Physical lines of code if (a b) c a; else c b; if (a b) { c a; } else { c b; } if (a b) { c a; } else { c b; } if (a b) c a; else c b; SE-280 Dr. Mark L. Hornick 3

As with many organizations, MSOE has adopted a Java Coding Standard In the SDL, the coding standard is: https://opal.msoe.edu/mediawiki/index.php/Java Coding Do cumentation Standard URL also included on course & lab web pages Following this standard, Logical LOC physical LOC Count physical lines to get logical Reasonable if each countable element is on a separate physical line Don’t count comments, blank lines Don’t count braces if on separate lines SE-280 Dr. Mark L. Hornick 4

Which LOC do we count? Actual Time (hrs) Only the code we’ve added or modified, and we count those equally. We don’t count code we haven’t touched or any code in libraries that we only use. 3.5 3 2.5 yk 2 1.5 1 0.5 0 0 50 100 xk 150 200 Actual Size (A M LOC) SE-280 Dr. Mark L. Hornick 5

When we build new code on an existing base, we must do size accounting properly in order to get meaningful results. Deleted Modified Added Unmodified Reused Base Program – e.g., cycle 1 New Program – e.g., cycle 2 Added and Modified New Reusable

Let's try an example. Total LOC for cycle 1 200 Total LOC for cycle 2 300 Modified LOC 25 Deleted LOC 50 Reused "Calc" class from another course project 50 LOC No new additions to “Reuse Library” Deleted Modified Added Unmodified Added and Modified New Reusable How much A M LOC? Reused Base Program New Program This is the accounting method used in the textbook.

Example solution Deleted Modified Unmodified Added Added and Modified New Reusable Total LOC for cycle 1 200 Total LOC for cycle 2 300 Modified LOC 25 Deleted LOC 50 Reused "Calc" class from an earlier project 50 LOC No new additions to “Reuse Library” How much A M LOC? Reused Base Program New Program This is the accounting method used in the textbook.

Code counting demo SE-280 Dr. Mark L. Hornick 9

Once we count LOC, we enter the values into PD PD maintains the historical time vs. effort relationships that can be used to make subsequent resource estimates More on that next week SE-280 Dr. Mark L. Hornick 10

Process improvement proposals (PIPs) are used to record process problems and possible solutions. Problem Proposed process modification Notes or comments

Before lab Review Java Coding Standard https://opal.msoe.edu/mediawiki/index.php/Ja va Coding Documentation Standard SE-280 Dr. Mark L. Hornick 12

Back to top button