Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Automated code coverage and cyclomatic complexity analyses

Part A: Installing Java SE Development Kit (JDK)

1. If you don't have any Java version installed on your computer, install Java SE Development Kit (JDK).

4. Note: if you have one or multiple java versions on your machine already, it may be advisable to install a new operating system virtual machine. Then install the new version of JDK on the OS virtual machine.

Part B: Obtaining C and C++ code counter

Part C: Generating software metrics and cyclomatic complexity

Find your assigned test application in Table 1 at the end of this document.

Change directory to the "src" folder that contains the java source files of your assigned java test application. note: for java2d, the java source files are in .\java2d\src\java2d folder.

First display date by typing command "date" in the command line.

Then display time by typing command "time" in the command line.

To generate software metrics of your assigned java test application, use the command "c:\{your cccc directory}\cccc.exe *.java".

A .cccc folder in {your assigned java test application directory}\src is created that contains the test results. View the report in the primary html output such as .cccc\cccc.html.

Part D: Obtaining EMMA

There is also an emma plug-in for Eclipse, if you are familiar with Eclipse. or do the following.

a. From your Eclipse menu select Help → Eclipse Marketplace. Search for eclEmma. Click install for "EclEmma Java Code Coverage". Follow the steps in the installation wizard.

b. Or From your Eclipse menu select Help → Install New Software... In the Install dialog enter http://update.eclemma.org/ at the Work with field. Check the latest EclEmma version and click Next. Follow the steps in the installation wizard.

Part E: Homework - Generating a code coverage report.

1. Find your assigned test application in Table 1 at the end of this document.

2. If you have Emma plug-in installed with Eclipse, try to generate coverage report

3. Otherwise, create a "test" folder under c:\ dirve such as c:\test.

4. Copy the folder containing jar file and src folder of your assigned test application to c:\test folder. note: use java.exe and test jar file from the same jdk package.

5. To run EMMA in a command window, first open a DOS command window.

6. Then display date by typing command "date" in the command line.

7. Then display time by typing command "time" in the command line.

8. Then set classpath by typing "set classpath=%CLASSPATH%;{your emma.jar directory}/emma.jar".

Note1: you need to make sure "java" command works first. Classpath should point to ".;javahome\jdk\bin" Note2: you may also do a "echo %classpath%" command to see if it contains ".;javahome\jdk\bin;{your emma.jar directory}/emma.jar"

9. Change directory to the folder that contains your assigned java test application. Note: use command "cd" to change directory, e.g., cd c:\test.

10. Use the command "java emmarun -r html -jar YourTestApp.jar" to generate a code coverage report.

11. Try to do or test a few things with the test application. Then exit application.

12. View code coverage report in html format by opening {your assigned java test application directory}\coverage\index.html. The percentage of code coverage depends on how much you do with the application.

13. Take screenshots of your work that contains DOS command window that shows classpath and execution log as well as the coverage report.

14. Check to see if the extent of testing in step 10 correlates with the percentage of code coverage in the report.

Java, Programming

  • Category:- Java
  • Reference No.:- M91236419

Have any Question?


Related Questions in Java

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As