DOC PREVIEW
ODU CS 350 - Assignment Kit for Program 2

This preview shows page 1-2-3-4-5 out of 15 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS 350 Assignment Kit for Program 2 Fall 2005 Version 1 0 subject to revision Program 2 February 2005 1 2005 by Carnegie Mellon University ODU Personal Software Process for Engineers Part I Assignment Kit for Program 2 Overview Overview This assignment kit covers the following topics Section Reference Program 2 See Page Prerequisites 2 Program 2 requirements 3 Regression overview 5 Using regression in the PSP 6 Calculating regression 7 A regression example 8 Assignment instructions 10 Due dates and evaluation criteria 15 PSP text Chapters 5 and 6 February 2005 2 2005 by Carnegie Mellon University ODU Program 2 requirements Using PSP0 1 write a program to calculate the linear regression parameters 0 and 1 for a set of n pairs of data given an estimate x k calculate an improved prediction yk where Program 2 requirements yk 0 1 xk enhance the linked list developed in program 1 to store the n data sets where each record holds two real numbers Table 1 contains historical estimated and actual data for 10 programs For program 11 the developer has estimated a proxy size of 386 LOC Thoroughly test the program At a minimum run the following four test cases Test 1 Calculate the regression parameters between estimated proxy size and actual added and modified size in Table 1 Calculate plan added and modified size given an estimated proxy size of x k 386 Test 2 Calculate the regression parameters between estimated proxy size and actual development time in Table 1 Calculate time estimate given an estimated proxy size of x k 386 Test 3 Calculate the regression parameters between plan added and modified size and actual added and modified size in Table 1 Calculate plan added and modified size given an estimated proxy size of x k 386 Test 4 Calculate the regression parameters between plan added and modified size and actual development time in Table 1 Calculate time estimate given an estimated proxy size of x k 386 Expected results are provided in Table 2 Program Number Estimated Proxy Size 1 2 3 4 5 6 7 8 9 10 130 650 99 150 128 302 95 945 368 961 Plan Added and Modified size 163 765 141 166 137 355 136 1206 433 1130 Actual Added and Modified Size 186 699 132 272 291 331 199 1890 788 1601 Actual Development Hours 15 0 69 9 6 5 22 4 28 4 65 9 19 4 198 7 38 8 138 2 Table 1 Continued on next page Program 2 February 2005 3 2005 by Carnegie Mellon University ODU Program 2 requirements Continued Expected results Test Test 1 Test 2 Test 3 Test 4 0 22 55 4 039 23 92 4 604 Expected Value 1 1 7279 0 1681 1 43097 0 140164 yk 644 429 60 858 528 4294 49 4994 0 Actual Value 1 yk Table 2 Program 2 February 2005 4 2005 by Carnegie Mellon University ODU Regression Overview Linear regression is a way of optimally fitting a line to a set of data The linear regression line is the line where the distance from all points to that line is minimized The equation of a line can be written as y 0 1 x Actual Development Hours In Figure 1 the best fit regression line has parameters of 0 4 0389 and 1 0 1681 250 200 y 4 0389 0 1681x 150 100 50 0 0 200 400 600 800 Estimated Proxy Size 1000 1200 Figure 1 Continued on next page Program 2 February 2005 5 2005 by Carnegie Mellon University ODU Regression Continued Using regression in the PSP Looking at Figure 1 how many hours do you think it would take to develop a program with an estimated proxy size of 500 Using PROBE method A for time the estimate would be TimeEstimate 0 1 500 or an estimate of 80 011 hours The PSP PROBE method uses regression parameters to make better predictions of size and time based on your historical data PROBE methods A and B differ only in the historical data x values used to calculate the regression parameters In PROBE method A estimated proxy size are used as the x values In PROBE method B plan added and modified size are used as the x values PROBE methods for size and time differ only in the historical data y values used to calculate the regression parameters To predict improved size estimates actual added and modified LOC are used as the y values To predict time estimates actual development times are used as the y values Historical Data Used PROBE A Size Estimating PROBE B PROBE A Time Estimating PROBE B x values Estimated Proxy Size Plan Added and Modified Size Estimated Proxy Size Plan Added and Modified Size y values Actual Added and Modified Size Actual Added and Modified Size Actual Development Time Actual Development Time Continued on next page Program 2 February 2005 6 2005 by Carnegie Mellon University ODU Regression Continued Calculating regression The formulas for calculating the regression parameters 0 and 1 are n xi yi nxavg yavg 1 i 1 n 2 xi2 nxavg i 1 0 yavg 1 xavg where is the symbol for summation i is an index to the n numbers x and y are the two paired sets of data n is the number of items in each set x and y x avg is the average of the x values yavg is the average of the y values Additional requirements Coding style You must use the class coding standard for this code The standard is available on the class web page in the same place as this assignment file Input Your program should read from standard input and read until end of file It should also write to standard output The files it read should contain only data to be used in computing the regression coefficients Thus if you were to compile your program and name the executable prog2 and your test data files were named data1 data2 and data3 your program could be run on these three files by typing prog2 data1 prog2 data2 prog2 data3 List structure As in program one you should again store the data in a linked list Program 2 February 2005 7 2005 by Carnegie Mellon University ODU A regression example In this example we will calculate the regression parameters 0 and 1 values of the data in the Table 3 A regression example n 1 2 3 4 5 6 7 8 9 10 x 130 650 99 150 128 302 95 945 368 961 y 186 699 132 272 291 331 199 1890 788 1601 Table 3 n xi yi nxavg yavg 1 i 1 n 2 xi2 nxavg i 1 1 In this example there are 10 items in each dataset and therefore we set n 10 2 We can now solve the summation items in the regression formula n 1 2 3 4 5 6 7 8 9 10 Total x 130 650 99 150 128 302 95 945 368 961 10 xi 3828 i 1 xavg 3828 382 8 10 x2 16900 422500 9801 22500 …


View Full Document

ODU CS 350 - Assignment Kit for Program 2

Download Assignment Kit for Program 2
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Assignment Kit for Program 2 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Assignment Kit for Program 2 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?