CS 2401 - AY2019-T3 Week 6 Discussion Question.pdf -...

Doc Preview
Pages 35
Identified Q&As 5
Solutions available
Total views 100+
01.04.2019CS 2401 - AY2019-T3: Week 6 Discussion Question 1/35HomeMy coursesCS 2401 - AY2019-T37 March - 13 March Discussion Forum Unit 6Week 6 Discussion Question Discussion Forum Unit 6 Week 6 Discussion Question Subscribed HOMECONTACT USRESOURCESLINKSFACULTY MY COURSES MENU     1 CS 2401 Software Engineering 1 - Term 3, 2018-2019 Search forums Week 6 Discussion Question by Jim Casale (Instructor) - Wednesday, 30 January 2019, 7:48 AM Explain why it is di±cult to validate the relationships between internal product attributes, such as cyclomatic complexity and external attributes, such as maintainability. 23 words Permalink | Reply Re: Week 6 Discussion Question by Johnathan Hopcraft - Thursday, 7 March 2019, 5:47 AM Starting with de²nitions, cyclomatic complexity is an internal metric that measures how many logical decisions or branches there are in a program (Marsic, 2012). This is used as a gauge of how complicated a program is and the potential di±culty in maintaining that program. That leads to maintainability which refers to how easy a program is to maintain, update, modify or debug. An external attribute such as maintainability depends on many factors, including internal factors like cyclomatic complexity. For example, a program with a high cyclomatic complexity (that suggests it would be hard to maintain), that has very clear
01.04.2019CS 2401 - AY2019-T3: Week 6 Discussion Question 2/35intuitive variables, well commented code, excellent documentation, being worked on by a highly experienced expert team would be easy to maintain. Alternately, a program with a low cyclomatic complexity (that suggest it would be easy to maintain), that has non-descriptive variables, no comments, no documentation, being worked on by me would be very hard to maintain. For example, the code below is very simple, with low cyclomatic complexity, can you guess what it does? importjava.util.Random; publicclasssamplemain{ publicstaticvoidmain (String[]args) { System.out.println(randomString(-229985452)+' '+randomString(-147909649)); } publicstaticString randomString(intseed) { Random rand =newRandom(seed); StringBuilder sb =newStringBuilder(); for(inti=0;;i++) { intn = rand.nextInt(27); if(n == 0)break; sb.append((char) ('`' + n)); } returnsb.toString(); } } It prints “hello world”. External attributes like maintainability and internal attributes like cyclomatic complexity are hard to validate. 247 words Permalink | Show parent | Reply Re: Week 6 Discussion Question by Natacia Mariott - Saturday, 9 March 2019, 2:55 PM Hi Johnathan!
01.04.2019CS 2401 - AY2019-T3: Week 6 Discussion Question 3/35Thank you for your thoughts. Your example was very good. I could not guess what it does! Comments and descriptive variables would have helped!
Course Hero Badge

Want to read all 35 pages?

Previewing 4 of 35 pages Upload your study docs or become a member.
Course Hero Badge

Want to read all 35 pages?

Previewing 4 of 35 pages Upload your study docs or become a member.
Course Hero Badge

End of preview

Want to read all 35 pages? Upload your study docs or become a member.