Assignment 4: Static Code Analysis and Unit Testing Solved

$24.99 $18.99

·Source code: CodingHorror.java; UnitTesting.zip. Import the project from the zip file to read the source codes. Part 1: Static Code Analysis Consider the CodingHorror program, although it compiles, it fails to do what the programmer wants. The programmer intends to read a string from the user, substitute all “e” characters with “o” characters, then check…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:

Description

5/5 – (2 votes)

·Source code: CodingHorror.java; UnitTesting.zip.

Import the project from the zip file to read the source codes.

Part 1: Static Code Analysis

Consider the CodingHorror program, although it compiles, it fails to do what the programmer wants. The programmer intends to read a string from the user, substitute all “e” characters with “o” characters, then check whether the substitution results in the string “pool”. This will never be the case, no matter what input we provide, because of faults in the code.

Your task is to utilize the static analysis tool FindBugs, a popular open source static code checker for Java, to find the FIVE bugs reported by the tool and contained within the code.

Hint: Sometimes one bug hides another bug; and the second bug is only revealed by removing the first bug. That is, think iteration.

Note 1: Findbugs is likely to report a sixth error, Internationalization. It is something that goes beyond the scope of previous Java classes so we will ignore this one.

Note 2: If you choose Firebugs version 3.0.0 or earlier (now the newest version is 3.0.1, as of Sept.

30, 2018), you can only get four bugs detected.

Compile theCodingHorror.javasource code into bytecodes file, and then start up the FindBugs program to analyze it: New Project > Classpath for analysis > Add > Analyze. The application will then produce a list of bugs that are present within your code.

Assignment https://eclass.srv.ualberta.ca/mod/assign/view.php?id=3237746

Assignment 4: Static Code Analysis and Unit Testing Solved
$24.99 $18.99