1. Install Junit(4.12), Hamcrest(1.3) with Eclipse

1.1 download Junit(4.12), Hamcrest(1.3)

Software Testing_Lab 1 Junit and Eclemma

 

Software Testing_Lab 1 Junit and Eclemma

1.2 Click the project with the right button, select properties ->Java Build Path ->Libraries->Add external JARs

Software Testing_Lab 1 Junit and Eclemma

Software Testing_Lab 1 Junit and Eclemma

Then select the junit-4.12.jar and Hamcrest-core-1.3

Software Testing_Lab 1 Junit and Eclemma

 

2. Install Eclemma with Eclipse

2.1. Put the Eclemma.zip under the directory

2.2. Click help->install new software->add

 

3.Write a java program for the triangle problem and test the program with junit.

3.1. Build a project and  Write the code.

Software Testing_Lab 1 Junit and Eclemma

3.2.Add a source folder which will contain test package and the test class and Write test code

Software Testing_Lab 1 Junit and Eclemma

3.3. Run it as JUnit test and use eclemma.

Software Testing_Lab 1 Junit and Eclemma

And then put it on GIT.

That's all.

 

相关文章: