0% found this document useful (0 votes)
7 views3 pages

Quiz 2: Basic Calculator Testing

The document outlines a practical lab quiz for SWE 434 Software Testing & Validation, focusing on testing a 'BasicCalculator' class using JUnit and EclEmma for code coverage. Students are required to download a project file, run tests, document coverage results, and answer specific questions regarding branch and line coverage for methods in the class. The quiz must be submitted as a Word file to the LMS before the deadline to avoid being marked late.

Uploaded by

rraaffeeeeff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Quiz 2: Basic Calculator Testing

The document outlines a practical lab quiz for SWE 434 Software Testing & Validation, focusing on testing a 'BasicCalculator' class using JUnit and EclEmma for code coverage. Students are required to download a project file, run tests, document coverage results, and answer specific questions regarding branch and line coverage for methods in the class. The quiz must be submitted as a Word file to the LMS before the deadline to avoid being marked late.

Uploaded by

rraaffeeeeff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SWE 434 Software Testing & Validation

Practical Lab Quiz [2] - 7 Marks


Duration: 50 mins - (12:05 - 12:55) PM

Student Identification:

Name
ID
Section Select your section

Problem Description:
● We have a ‘BasicCalculator’ class with some functionality of the Basic Calculator
Operations (Addition, Subtraction, Division, Multiplication, Power).
● We have several tests to test the Calculator. JUNIT Test Class is implemented under the
test folder.
Step-1:
Source Project:
● Access your LMS account.
● Download the file under the Quizzes > Quiz2 > [Link].
● Import the zip file into Eclipse.
Step-2:
● Run Test Class with the Coverage Tool, EclEmma.
● Write the coverage results on the ‘BasicCalculator’ class and the methods inside it based
on the following questions.
● For each answer, Take a screenshots for the “coverage result” view.
● NOTE: Below Table must be filled very clean, cuttings may deduct some marks.
Screenshot must be taken to show the complete coverage view.

Criteria Result Screenshot

Class branch
1
coverage %

Number of covered
branches in
2
Calculator()
method
Number of covered
3
lines in class

Class total
4
instructions

Number of
5 uncovered lines in
div() method

Method(s) that has


the highest total
6 regarding
instruction
coverage

Class method
7
coverage %

Complexity % of
8
div()

Number of covered
9
type in class

Method(s) that
have the least
10
complexity
coverage %

Step-3: Short questions


● How to achieve 100% branch coverage of div() method? Give an example of a test case.

TC Input Actual Expected Verdict


1

● How to achieve 100% line coverage of mult() method? Give an example of a test cases.

TC Input Actual Expected Verdict


2

Step-4: Quiz submission


1. Upload your Word file to LMS (under Quiz 2 Assignment).
2. Make sure to submit the file before 1:00 PM otherwise, you will be considered as LATE.

You might also like