commit c270120d636d2b8a1d1d687067343881985c28fb Author: Asiek Date: Tue Jun 21 20:39:10 2022 +0200 testy mutacyjne diff --git a/testy oryginalne/BMITest.java b/testy oryginalne/BMITest.java new file mode 100644 index 0000000..299a1e6 --- /dev/null +++ b/testy oryginalne/BMITest.java @@ -0,0 +1,112 @@ +package com.epam.bootcamp.bmi_calculator; + +import static org.junit.Assert.*; + +import org.junit.*; +import org.junit.rules.ExpectedException; + +import com.epam.bootcamp.bmi_calculator.interfacesImplements.MetricBMI; + +public class +BMITest { + + App app; + + /*@Test + public void GuessTheUnitsTest1() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(1.7,50.0); + assertEquals(gtu.getUnitType(),"metric"); + } + + @Test + public void GuessTheUnitsTest2() throws Exception{ + + }*/ + + @Before + public void setup(){ + app = new App(); + } + + @Test + public void BMITest1() throws Exception{ + app.setHeight(1.7); + app.setWeight(50); + assertEquals(app.calculateBMI(),17.3,1); + assertEquals(app.bmiResult(),"Thinness"); + } + + @Test + public void BMITest2() throws Exception{ + try{ + app.setHeight(0); + app.setWeight(50.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + + @Test + public void BMITest3() throws Exception{ + try{ + app.setHeight(1); + app.setWeight(-3); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + + @Test + public void BMITest4() throws Exception{ + try{ + app.setHeight(170); + app.setWeight(1764); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height and weight is in different metric."); + } + } + + @Test + public void BMITest5() throws Exception{ + app.setHeight(170); + app.setWeight(50.0); + assertEquals(app.calculateBMI(),17.3,1); + assertEquals(app.bmiResult(),"Thinness"); + } + + @Test + public void BMITest6() throws Exception{ + app.setHeight(5.58); + app.setWeight(1764); + assertEquals(app.calculateBMI(),17.3,1); + assertEquals(app.bmiResult(),"Thinness"); + } + + @Test + public void BMITest7() throws Exception{ + app.setHeight(86.7); + app.setWeight(6349.3); + assertEquals(app.calculateBMI(),37.19,0.5); + assertEquals(app.bmiResult(),"Heavily overweight"); + } + + @Test + public void BMITest8() throws Exception{ + app.setHeight(6.56); + app.setWeight(220.47); + assertEquals(app.calculateBMI(),25,0.5); + assertEquals(app.bmiResult(),"Overweight"); + } + + @Test + public void BMITest9() throws Exception{ + app.setHeight(200); + app.setWeight(80); + assertEquals(app.calculateBMI(),20,0.0); + assertEquals(app.bmiResult(),"Normal"); + } + +} \ No newline at end of file diff --git a/testy oryginalne/GuessTheUnitsTest.java b/testy oryginalne/GuessTheUnitsTest.java new file mode 100644 index 0000000..b9d7471 --- /dev/null +++ b/testy oryginalne/GuessTheUnitsTest.java @@ -0,0 +1,38 @@ +package com.epam.bootcamp.bmi_calculator; + +import static org.junit.Assert.*; + +import org.junit.*; + +public class GuessTheUnitsTest { + + @Test + public void GuessTheUnitsTest1() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(1.7,50.0); + assertEquals(gtu.getUnitType(),"metric"); + } + + @Test + public void GuessTheUnitsTest2() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(170,50.0); + assertEquals(gtu.getUnitType(),"metric"); + } + + @Test + public void GuessTheUnitsTest3() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(5.58,1764); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),110,1); + } + + @Test + public void GuessTheUnitsTest4() throws Exception{ + try{ + GuessTheUnits gtu = new GuessTheUnits(170,1764); + assertEquals(gtu.getUnitType(),"US"); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height and weight is in different metric."); + } + } + +} \ No newline at end of file diff --git a/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html b/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html new file mode 100644 index 0000000..5d2cedc --- /dev/null +++ b/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html @@ -0,0 +1,345 @@ + + + + + + + + + +

MetricBMI.java

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +1 + + + + + + +
package com.epam.bootcamp.bmi_calculator.interfacesImplements;
+ +2 + + + + + + +
+ +3 + + + + + + +
import com.epam.bootcamp.bmi_calculator.interfaces.UnitsInterface;
+ +4 + + + + + + +
+ +5 + + + + + + +
public class MetricBMI implements UnitsInterface{
+ +6 + + + + + + +
	
+ +7 + + + + + + +
	private double bmi;
+ +8 + + + + + + +
	
+ +9 + + + + + + +
	public double getBMI(){
+ +10 + + +1 + + +1. getBMI : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI::getBMI → KILLED
+ +
+
+
		return this.bmi;
+ +11 + + + + + + +
	}
+ +12 + + + + + + +
	
+ +13 + + + + + + +
	public void setBMI(double weight, double height){
+ +14 + + +2 + + +1. setBMI : Replaced double multiplication with division → KILLED
+ +2. setBMI : Replaced double division with multiplication → KILLED
+ +
+
+
		this.bmi = weight/(height*height); //számolja a metrikus BMI-t
+ +15 + + + + + + +
	}
+ +16 + + + + + + +
	
+ +17 + + + + + + +
}

Mutations

10 + + + +

1.1
Location : getBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI::getBMI → KILLED

+
14 + + + +

1.1
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

2.2
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double division with multiplication → KILLED

+
+ + +

Active mutators

+ + +

Tests examined

+ + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html b/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html new file mode 100644 index 0000000..1c12774 --- /dev/null +++ b/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html @@ -0,0 +1,422 @@ + + + + + + + + + +

UsBMI.java

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +1 + + + + + + +
package com.epam.bootcamp.bmi_calculator.interfacesImplements;
+ +2 + + + + + + +
+ +3 + + + + + + +
import com.epam.bootcamp.bmi_calculator.interfaces.UnitsInterface;
+ +4 + + + + + + +
+ +5 + + + + + + +
public class UsBMI implements UnitsInterface{
+ +6 + + + + + + +
	
+ +7 + + + + + + +
	private static final int usMultiplier = 703;
+ +8 + + + + + + +
	
+ +9 + + + + + + +
	private double bmi;
+ +10 + + + + + + +
	
+ +11 + + + + + + +
	public double getBMI(){
+ +12 + + +1 + + +1. getBMI : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI::getBMI → KILLED
+ +
+
+
		return this.bmi;
+ +13 + + + + + + +
	}
+ +14 + + + + + + +
	
+ +15 + + + + + + +
	/**
+ +16 + + + + + + +
	 * A US mértékegységnél kell konstans, amilve meg kell szorozni a súlyt. Ezt a szorzót a usMultiplier konstans tartalmazza
+ +17 + + + + + + +
	 */
+ +18 + + + + + + +
	public void setBMI(double weight, double height){
+ +19 + + +3 + + +1. setBMI : Replaced double multiplication with division → KILLED
+ +2. setBMI : Replaced double multiplication with division → KILLED
+ +3. setBMI : Replaced double division with multiplication → KILLED
+ +
+
+
		this.bmi = usMultiplier*weight/(height*height); // számolja a US bmi-t
+ +20 + + + + + + +
	}
+ +21 + + + + + + +
	
+ +22 + + + + + + +
}

Mutations

12 + + + +

1.1
Location : getBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest7(com.epam.bootcamp.bmi_calculator.BMITest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI::getBMI → KILLED

+
19 + + + +

1.1
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest7(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

2.2
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest7(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

3.3
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest7(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double division with multiplication → KILLED

+
+ + +

Active mutators

+ + +

Tests examined

+ + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html b/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html new file mode 100644 index 0000000..6da533c --- /dev/null +++ b/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html @@ -0,0 +1,69 @@ + + + + + + + + +

Pit Test Coverage Report

+

Package Summary

+

com.epam.bootcamp.bmi_calculator.interfacesImplements

+ + + + + + + + + + + + + + + + + +
Number of ClassesLine CoverageMutation CoverageTest Strength
2100%
8/8
100%
7/7
100%
7/7
+ + +

Breakdown by Class

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameLine CoverageMutation CoverageTest Strength
MetricBMI.java
100%
4/4
100%
3/3
100%
3/3
UsBMI.java
100%
4/4
100%
4/4
100%
4/4
+
+ + + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator/App.java.html b/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator/App.java.html new file mode 100644 index 0000000..0514463 --- /dev/null +++ b/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator/App.java.html @@ -0,0 +1,1473 @@ + + + + + + + + + +

App.java

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +1 + + + + + + +
package com.epam.bootcamp.bmi_calculator;
+ +2 + + + + + + +
+ +3 + + + + + + +
import com.epam.bootcamp.bmi_calculator.interfacesImplements.*;
+ +4 + + + + + + +
+ +5 + + + + + + +
public class App extends Exception
+ +6 + + + + + + +
{
+ +7 + + + + + + +
+ +8 + + + + + + +
	private double weight;
+ +9 + + + + + + +
	private double height;
+ +10 + + + + + + +
	private double bmi;
+ +11 + + + + + + +
	
+ +12 + + + + + + +
	/**
+ +13 + + + + + + +
	 * A ZeroChecker megnézi, hogy nulla vagy kevesebb-e a súly vagy a magasság.
+ +14 + + + + + + +
	 * Ha valamelyik nulla vagy kevesebb, akkor hibát dob.
+ +15 + + + + + + +
	 */
+ +16 + + + + + + +
	private void ZeroChecker() throws Exception{
+ +17 + + +2 + + +1. ZeroChecker : changed conditional boundary → SURVIVED
+ +2. ZeroChecker : negated conditional → KILLED
+ +
+
+
		if(this.weight <= 0){
+ +18 + + + + + + +
			throw new Exception("Weight is equals or less than zero.");
+ +19 + + + + + + +
		}
+ +20 + + +2 + + +1. ZeroChecker : changed conditional boundary → SURVIVED
+ +2. ZeroChecker : negated conditional → KILLED
+ +
+
+
		if(this.height <= 0){
+ +21 + + + + + + +
			throw new Exception("Height is equals or less than zero.");
+ +22 + + + + + + +
		}	
+ +23 + + + + + + +
	}
+ +24 + + + + + + +
	
+ +25 + + + + + + +
	/**
+ +26 + + + + + + +
	 * Ez adja értéknek a BMI-t a bmi változónak.
+ +27 + + + + + + +
	 * Először megnézi a ZeroCheckerrel a kapott értékeket.
+ +28 + + + + + + +
	 * Meghívja a GuessTheUnits osztályt, ami kitalálja, hogy milyen mértékegységekkel számoljuk a BMI-t(US vagy metric).
+ +29 + + + + + + +
	 * Attól függően, hogy mi a mértékegység, hívjuk meg a számolót.
+ +30 + + + + + + +
	 * @return a bmi értékével tér vissza a metódus
+ +31 + + + + + + +
	 * @throws Exception
+ +32 + + + + + + +
	 */
+ +33 + + + + + + +
	public double calculateBMI() throws Exception{ //végül kiszámoljuk a BMI-t
+ +34 + + +1 + + +1. calculateBMI : removed call to com/epam/bootcamp/bmi_calculator/App::ZeroChecker → SURVIVED
+ +
+
+
		ZeroChecker();
+ +35 + + + + + + +
		GuessTheUnits gtu = new GuessTheUnits(this.height, this.weight);
+ +36 + + +1 + + +1. calculateBMI : negated conditional → KILLED
+ +
+
+
		if(gtu.getUnitType().equals("US")){
+ +37 + + + + + + +
			UsBMI ubmi = new UsBMI();
+ +38 + + +1 + + +1. calculateBMI : removed call to com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI::setBMI → KILLED
+ +
+
+
			ubmi.setBMI(gtu.getWeight(), gtu.getHeight());
+ +39 + + + + + + +
			this.bmi = ubmi.getBMI();
+ +40 + + +1 + + +1. calculateBMI : negated conditional → KILLED
+ +
+
+
		}else if(gtu.getUnitType().equals("metric")){
+ +41 + + + + + + +
			MetricBMI mbmi = new MetricBMI();
+ +42 + + +1 + + +1. calculateBMI : removed call to com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI::setBMI → KILLED
+ +
+
+
			mbmi.setBMI(gtu.getWeight(), gtu.getHeight());
+ +43 + + + + + + +
			this.bmi = mbmi.getBMI();
+ +44 + + + + + + +
		}
+ +45 + + +1 + + +1. calculateBMI : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/App::calculateBMI → KILLED
+ +
+
+
		return this.bmi;
+ +46 + + + + + + +
	}
+ +47 + + + + + + +
	
+ +48 + + + + + + +
	/**
+ +49 + + + + + + +
	 * A bmi változó értékétől függően kapjuk meg az adott ember értékelését
+ +50 + + + + + + +
	 * @return Egy string, ami tartalmazza az értékelést
+ +51 + + + + + + +
	 */
+ +52 + + + + + + +
	public String bmiResult(){
+ +53 + + +2 + + +1. bmiResult : changed conditional boundary → SURVIVED
+ +2. bmiResult : negated conditional → KILLED
+ +
+
+
		if(this.bmi < 18.5){ // Sovány
+ +54 + + +1 + + +1. bmiResult : replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED
+ +
+
+
			return "Thinness";
+ +55 + + +4 + + +1. bmiResult : changed conditional boundary → SURVIVED
+ +2. bmiResult : changed conditional boundary → SURVIVED
+ +3. bmiResult : negated conditional → KILLED
+ +4. bmiResult : negated conditional → KILLED
+ +
+
+
		}else if(this.bmi >= 18.5 && this.bmi <= 24.9){ // Normál testalkatú
+ +56 + + +1 + + +1. bmiResult : replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED
+ +
+
+
			return "Normal";
+ +57 + + +4 + + +1. bmiResult : changed conditional boundary → SURVIVED
+ +2. bmiResult : changed conditional boundary → SURVIVED
+ +3. bmiResult : negated conditional → KILLED
+ +4. bmiResult : negated conditional → KILLED
+ +
+
+
		}else if(this.bmi > 24.9 && this.bmi <= 29.9){ // Túlsúlyos
+ +58 + + +1 + + +1. bmiResult : replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED
+ +
+
+
			return "Overweight";
+ +59 + + + + + + +
		}else{ // Erősen túlsúlyos
+ +60 + + +1 + + +1. bmiResult : replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED
+ +
+
+
			return "Heavily overweight";
+ +61 + + + + + + +
		}
+ +62 + + + + + + +
	}
+ +63 + + + + + + +
	
+ +64 + + + + + + +
	/**
+ +65 + + + + + + +
	 * Súly beállítása
+ +66 + + + + + + +
	 * @param weight a súly
+ +67 + + + + + + +
	 */
+ +68 + + + + + + +
	public void setWeight(double weight){
+ +69 + + + + + + +
		this.weight = weight;
+ +70 + + + + + + +
	}
+ +71 + + + + + + +
	
+ +72 + + + + + + +
	/**
+ +73 + + + + + + +
	 * Magasság beállítása
+ +74 + + + + + + +
	 * @param height a magasság
+ +75 + + + + + + +
	 */
+ +76 + + + + + + +
	public void setHeight(double height){
+ +77 + + + + + + +
		this.height = height;
+ +78 + + + + + + +
	}
+ +79 + + + + + + +
}

Mutations

17 + + + +

1.1
Location : ZeroChecker
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : ZeroChecker
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest2(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
20 + + + +

1.1
Location : ZeroChecker
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : ZeroChecker
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest4(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
34 + + + +

1.1
Location : calculateBMI
Killed by : none
removed call to com/epam/bootcamp/bmi_calculator/App::ZeroChecker → SURVIVED

+
36 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
38 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest7(com.epam.bootcamp.bmi_calculator.BMITest)
removed call to com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI::setBMI → KILLED

+
40 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
42 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
removed call to com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI::setBMI → KILLED

+
45 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/App::calculateBMI → KILLED

+
53 + + + +

1.1
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
54 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED

+
55 + + + +

1.1
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

3.3
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest9(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

4.4
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest7(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
56 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest9(com.epam.bootcamp.bmi_calculator.BMITest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED

+
57 + + + +

1.1
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

3.3
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest8(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

4.4
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest7(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
58 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest8(com.epam.bootcamp.bmi_calculator.BMITest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED

+
60 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest7(com.epam.bootcamp.bmi_calculator.BMITest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED

+
+ + +

Active mutators

+ + +

Tests examined

+ + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html b/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html new file mode 100644 index 0000000..2f5d727 --- /dev/null +++ b/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html @@ -0,0 +1,1900 @@ + + + + + + + + + +

GuessTheUnits.java

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +1 + + + + + + +
package com.epam.bootcamp.bmi_calculator;
+ +2 + + + + + + +
+ +3 + + + + + + +
public class GuessTheUnits{
+ +4 + + + + + + +
+ +5 + + + + + + +
	private double height;
+ +6 + + + + + + +
	private double weight;	
+ +7 + + + + + + +
	private String unitType;
+ +8 + + + + + + +
	
+ +9 + + + + + + +
	
+ +10 + + + + + + +
	/**
+ +11 + + + + + + +
	 * Váltószám konstansok
+ +12 + + + + + + +
	 */
+ +13 + + + + + + +
	private static final double ouncesToPounds = 0.0625;
+ +14 + + + + + + +
	private static final double centimeterToMeter = 100;
+ +15 + + + + + + +
	private static final double feetToInch = 12;
+ +16 + + + + + + +
	
+ +17 + + + + + + +
	public GuessTheUnits(double height, double weight) throws Exception{
+ +18 + + + + + + +
		this.height = height;
+ +19 + + + + + + +
		this.weight = weight;
+ +20 + + +1 + + +1. <init> : removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::guessUnit → KILLED
+ +
+
+
		guessUnit();
+ +21 + + + + + + +
	}
+ +22 + + + + + + +
	
+ +23 + + + + + + +
	/**
+ +24 + + + + + + +
	 * A mértékegység megállapító metódus.
+ +25 + + + + + + +
	 * Ha a magasság kisebb száznál, és azon belül 10 és 3 között van, akkor feetben kaptuk a magasságot.
+ +26 + + + + + + +
	 * Ha a magasság kisebb száznál, de nagyobb vagy egyenlő 10-el, akkor inchben.
+ +27 + + + + + + +
	 * Ha a magasság kisebb vagy egyenlő 3-al, akkor méterben.
+ +28 + + + + + + +
	 * Ha a magasság nagyobb száznál, akkor pedig centiméterben.
+ +29 + + + + + + +
	 * 
+ +30 + + + + + + +
	 * A magasság alapján meg tudjuk mondani, hogy milyen mértékegységben kaphattuk a súlyt.
+ +31 + + + + + + +
	 * Ha US mértékegységet használunk és a súly nagyobb mint ezer, akkor ounces-ban kaptuk meg a súlyt.
+ +32 + + + + + + +
	 * Ha metrikus mértékegységet használunk, és a súly nagyobb mint ezer, valószínűleg két különböző mértékegységben
+ +33 + + + + + + +
	 * kaptuk meg a magasságot és a súlyt, ezért hibát dob.
+ +34 + + + + + + +
	 * 
+ +35 + + + + + + +
	 * Ha feetben, centiméterben vagy ounces-ban kaptuk valamelyik értéket, a convertUnit metódussal át kell alakítanunk azt.
+ +36 + + + + + + +
	 * @throws Exception
+ +37 + + + + + + +
	 */
+ +38 + + + + + + +
	private void guessUnit() throws Exception{ // kitaláljuk a mértékegységet
+ +39 + + +2 + + +1. guessUnit : changed conditional boundary → SURVIVED
+ +2. guessUnit : negated conditional → KILLED
+ +
+
+
		if(this.height < 100){
+ +40 + + +4 + + +1. guessUnit : changed conditional boundary → SURVIVED
+ +2. guessUnit : changed conditional boundary → SURVIVED
+ +3. guessUnit : negated conditional → KILLED
+ +4. guessUnit : negated conditional → KILLED
+ +
+
+
			if(this.height < 10 && this.height > 3){ // feet
+ +41 + + +1 + + +1. guessUnit : removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED
+ +
+
+
				convertUnit("feet"); //átkonvertáljuk inch-re
+ +42 + + + + + + +
				this.unitType = "US";
+ +43 + + +2 + + +1. guessUnit : changed conditional boundary → SURVIVED
+ +2. guessUnit : negated conditional → KILLED
+ +
+
+
			}else if(this.height >= 10){ // inch
+ +44 + + + + + + +
				this.unitType = "US";
+ +45 + + + + + + +
			}else{ // meter
+ +46 + + + + + + +
				this.unitType = "metric";
+ +47 + + + + + + +
			}
+ +48 + + + + + + +
		}else{ // centimeter
+ +49 + + +1 + + +1. guessUnit : removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED
+ +
+
+
			convertUnit("centimeter"); //átkonvertáljuk méterre
+ +50 + + + + + + +
			this.unitType = "metric";
+ +51 + + + + + + +
		}
+ +52 + + + + + + +
		
+ +53 + + +1 + + +1. guessUnit : negated conditional → KILLED
+ +
+
+
		if(this.unitType.equals("US")){ // ounces
+ +54 + + +2 + + +1. guessUnit : changed conditional boundary → SURVIVED
+ +2. guessUnit : negated conditional → KILLED
+ +
+
+
			if(this.weight > 1000){
+ +55 + + +1 + + +1. guessUnit : removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED
+ +
+
+
				convertUnit("ounces"); //átkonvertáljuk fontra
+ +56 + + + + + + +
			}
+ +57 + + + + + + +
		}else{
+ +58 + + +2 + + +1. guessUnit : changed conditional boundary → SURVIVED
+ +2. guessUnit : negated conditional → KILLED
+ +
+
+
			if(this.weight > 1000){
+ +59 + + + + + + +
				throw new Exception("Height and weight is in different metric.");
+ +60 + + + + + + +
			}
+ +61 + + + + + + +
		}
+ +62 + + + + + + +
	}
+ +63 + + + + + + +
	
+ +64 + + + + + + +
	
+ +65 + + + + + + +
	/**
+ +66 + + + + + + +
	 * Átváltja a mértékegységeket egységesre.
+ +67 + + + + + + +
	 * @param unit
+ +68 + + + + + + +
	 */
+ +69 + + + + + + +
	private void convertUnit(String unit){
+ +70 + + +1 + + +1. convertUnit : negated conditional → KILLED
+ +
+
+
		if(unit.equals("ounces")){
+ +71 + + +1 + + +1. convertUnit : Replaced double multiplication with division → KILLED
+ +
+
+
			this.weight = this.weight * ouncesToPounds;
+ +72 + + + + + + +
		}
+ +73 + + +1 + + +1. convertUnit : negated conditional → KILLED
+ +
+
+
		if(unit.equals("feet")){
+ +74 + + +1 + + +1. convertUnit : Replaced double multiplication with division → KILLED
+ +
+
+
			this.height = this.height * feetToInch;
+ +75 + + + + + + +
		}
+ +76 + + +1 + + +1. convertUnit : negated conditional → KILLED
+ +
+
+
		if(unit.equals("centimeter")){
+ +77 + + +1 + + +1. convertUnit : Replaced double division with multiplication → KILLED
+ +
+
+
			this.height = this.height / centimeterToMeter;
+ +78 + + + + + + +
		}
+ +79 + + + + + + +
	}
+ +80 + + + + + + +
	
+ +81 + + + + + + +
	/**
+ +82 + + + + + + +
	 * Súly getter
+ +83 + + + + + + +
	 * @return a súly
+ +84 + + + + + + +
	 */
+ +85 + + + + + + +
	public double getWeight(){
+ +86 + + +1 + + +1. getWeight : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getWeight → KILLED
+ +
+
+
		return this.weight;
+ +87 + + + + + + +
	}
+ +88 + + + + + + +
	
+ +89 + + + + + + +
	/**
+ +90 + + + + + + +
	 * Magasság getter
+ +91 + + + + + + +
	 * @return magasság
+ +92 + + + + + + +
	 */
+ +93 + + + + + + +
	public double getHeight(){
+ +94 + + +1 + + +1. getHeight : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getHeight → KILLED
+ +
+
+
		return this.height;
+ +95 + + + + + + +
	}
+ +96 + + + + + + +
	
+ +97 + + + + + + +
	/**
+ +98 + + + + + + +
	 * A mértékegység típusa getter
+ +99 + + + + + + +
	 * @return mértékegység típusa
+ +100 + + + + + + +
	 */
+ +101 + + + + + + +
	public String getUnitType(){
+ +102 + + +1 + + +1. getUnitType : replaced return value with "" for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getUnitType → KILLED
+ +
+
+
		return this.unitType;
+ +103 + + + + + + +
	}
+ +104 + + + + + + +
}

Mutations

20 + + + +

1.1
Location : <init>
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest4(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::guessUnit → KILLED

+
39 + + + +

1.1
Location : guessUnit
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest2(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
40 + + + +

1.1
Location : guessUnit
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : guessUnit
Killed by : none
changed conditional boundary → SURVIVED

3.3
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest3(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

4.4
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest1(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
41 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest6(com.epam.bootcamp.bmi_calculator.BMITest)
removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED

+
43 + + + +

1.1
Location : guessUnit
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest1(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
49 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED

+
53 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest4(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
54 + + + +

1.1
Location : guessUnit
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest3(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
55 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest3(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED

+
58 + + + +

1.1
Location : guessUnit
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest4(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
70 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest4(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
71 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest3(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
Replaced double multiplication with division → KILLED

+
73 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
74 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest6(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

+
76 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
77 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double division with multiplication → KILLED

+
86 + + + +

1.1
Location : getWeight
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest3(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getWeight → KILLED

+
94 + + + +

1.1
Location : getHeight
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getHeight → KILLED

+
102 + + + +

1.1
Location : getUnitType
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest2(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getUnitType → KILLED

+
+ + +

Active mutators

+ + +

Tests examined

+ + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator/index.html b/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator/index.html new file mode 100644 index 0000000..210407a --- /dev/null +++ b/testy oryginalne/raport/com.epam.bootcamp.bmi_calculator/index.html @@ -0,0 +1,69 @@ + + + + + + + + +

Pit Test Coverage Report

+

Package Summary

+

com.epam.bootcamp.bmi_calculator

+ + + + + + + + + + + + + + + + + +
Number of ClassesLine CoverageMutation CoverageTest Strength
2100%
58/58
72%
36/50
72%
36/50
+ + +

Breakdown by Class

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameLine CoverageMutation CoverageTest Strength
App.java
100%
28/28
67%
16/24
67%
16/24
GuessTheUnits.java
100%
30/30
77%
20/26
77%
20/26
+
+ + + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy oryginalne/raport/index.html b/testy oryginalne/raport/index.html new file mode 100644 index 0000000..7c5528c --- /dev/null +++ b/testy oryginalne/raport/index.html @@ -0,0 +1,72 @@ + + + + + + + + +

Pit Test Coverage Report

+ +

Project Summary

+ + + + + + + + + + + + + + + + + +
Number of ClassesLine CoverageMutation CoverageTest Strength
4100%
66/66
75%
43/57
75%
43/57
+ + +

Breakdown by Package

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameNumber of ClassesLine CoverageMutation CoverageTest Strength
com.epam.bootcamp.bmi_calculator2
100%
58/58
72%
36/50
72%
36/50
com.epam.bootcamp.bmi_calculator.interfacesImplements2
100%
8/8
100%
7/7
100%
7/7
+
+ + + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy oryginalne/raport/style.css b/testy oryginalne/raport/style.css new file mode 100644 index 0000000..303bfba --- /dev/null +++ b/testy oryginalne/raport/style.css @@ -0,0 +1,563 @@ +html, body, div, span, p, blockquote, pre { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +body{ + line-height: 1; + color: black; + background: white; + margin-left: 20px; +} + +.src { + border: 1px solid #dddddd; + padding-top: 10px; + padding-right: 5px; + padding-left: 5px; + font-family: Consolas, Courier, monospace; +} + +.covered, .COVERED { + background-color: #ddffdd; +} + +.uncovered, .UNCOVERED { + background-color: #ffdddd; +} + +.killed, .KILLED { + background-color: #aaffaa; +} + +.survived, .SURVIVED { + background-color: #ffaaaa; +} + +.uncertain, .UNCERTAIN { + background-color: #dde7ef; +} + +.run_error, .RUN_ERROR { + background-color: #dde7ef; +} + +.na { + background-color: #eeeeee; +} + +.timed_out, .TIMED_OUT { + background-color: #dde7ef; +} + +.non_viable, .NON_VIABLE { + background-color: #aaffaa; +} + +.memory_error, .MEMORY_ERROR { + background-color: #dde7ef; +} + +.not_started, .NO_STARTED { + background-color: #dde7ef; color : red +} + +.no_coverage, .NO_COVERAGE { + background-color: #ffaaaa; +} + +.tests { + width: 50%; + float: left; +} + +.mutees { + float: right; + width: 50%; +} + +.unit { + padding-top: 20px; + clear: both; +} + +.coverage_bar { + display: inline-block; + height: 1.1em; + width: 130px; + background: #FAA; + margin: 0 5px; + vertical-align: middle; + border: 1px solid #AAA; + position: relative; +} + +.coverage_complete { + display: inline-block; + height: 100%; + background: #DFD; + float: left; +} + +.coverage_legend { + position: absolute; + height: 100%; + width: 100%; + left: 0; + top: 0; + text-align: center; +} + +.line, .mut { + vertical-align: middle; +} + +.coverage_percentage { + display: inline-block; + width: 3em; + text-align: right; +} + +.pop { + outline:none; +} + +.pop strong { + line-height: 30px; +} + +.pop { + text-decoration: none; +} + +.pop span { + z-index: 10; + display: none; + padding: 14px 20px; + margin-top: -30px; + margin-left: 28px; + width: 800px; + line-height: 16px; + word-wrap: break-word; + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -moz-box-shadow: 5px 5px 8px #CCC; + -webkit-box-shadow: 5px 5px 8px #CCC; + box-shadow: 5px 5px 8px #CCC; +} + +.pop:hover span { + display: inline; + position: absolute; + color: #111; + border: 1px solid #DCA; + background: #fffAF0; +} + +.width-1 { + width: 1%; +} + +.width-2 { + width: 2%; +} + +.width-3 { + width: 3%; +} + +.width-4 { + width: 4%; +} + +.width-5 { + width: 5%; +} + +.width-6 { + width: 6%; +} + +.width-7 { + width: 7%; +} + +.width-8 { + width: 8%; +} + +.width-9 { + width: 9%; +} + +.width-10 { + width: 10%; +} + +.width-11 { + width: 11%; +} + +.width-12 { + width: 12%; +} + +.width-13 { + width: 13%; +} + +.width-14 { + width: 14%; +} + +.width-15 { + width: 15%; +} + +.width-16 { + width: 16%; +} + +.width-17 { + width: 17%; +} + +.width-18 { + width: 18%; +} + +.width-19 { + width: 19%; +} + +.width-20 { + width: 20%; +} + +.width-21 { + width: 21%; +} + +.width-22 { + width: 22%; +} + +.width-23 { + width: 23%; +} + +.width-24 { + width: 24%; +} + +.width-25 { + width: 25%; +} + +.width-26 { + width: 26%; +} + +.width-27 { + width: 27%; +} + +.width-28 { + width: 28%; +} + +.width-29 { + width: 29%; +} + +.width-30 { + width: 30%; +} + +.width-31 { + width: 31%; +} + +.width-32 { + width: 32%; +} + +.width-33 { + width: 33%; +} + +.width-34 { + width: 34%; +} + +.width-35 { + width: 35%; +} + +.width-36 { + width: 36%; +} + +.width-37 { + width: 37%; +} + +.width-38 { + width: 38%; +} + +.width-39 { + width: 39%; +} + +.width-40 { + width: 40%; +} + +.width-41 { + width: 41%; +} + +.width-42 { + width: 42%; +} + +.width-43 { + width: 43%; +} + +.width-44 { + width: 44%; +} + +.width-45 { + width: 45%; +} + +.width-46 { + width: 46%; +} + +.width-47 { + width: 47%; +} + +.width-48 { + width: 48%; +} + +.width-49 { + width: 49%; +} + +.width-50 { + width: 50%; +} + +.width-51 { + width: 51%; +} + +.width-52 { + width: 52%; +} + +.width-53 { + width: 53%; +} + +.width-54 { + width: 54%; +} + +.width-55 { + width: 55%; +} + +.width-56 { + width: 56%; +} + +.width-57 { + width: 57%; +} + +.width-58 { + width: 58%; +} + +.width-59 { + width: 59%; +} + +.width-60 { + width: 60%; +} + +.width-61 { + width: 61%; +} + +.width-62 { + width: 62%; +} + +.width-63 { + width: 63%; +} + +.width-64 { + width: 64%; +} + +.width-65 { + width: 65%; +} + +.width-66 { + width: 66%; +} + +.width-67 { + width: 67%; +} + +.width-68 { + width: 68%; +} + +.width-69 { + width: 69%; +} + +.width-70 { + width: 70%; +} + +.width-71 { + width: 71%; +} + +.width-72 { + width: 72%; +} + +.width-73 { + width: 73%; +} + +.width-74 { + width: 74%; +} + +.width-75 { + width: 75%; +} + +.width-76 { + width: 76%; +} + +.width-77 { + width: 77%; +} + +.width-78 { + width: 78%; +} + +.width-79 { + width: 79%; +} + +.width-80 { + width: 80%; +} + +.width-81 { + width: 81%; +} + +.width-82 { + width: 82%; +} + +.width-83 { + width: 83%; +} + +.width-84 { + width: 84%; +} + +.width-85 { + width: 85%; +} + +.width-86 { + width: 86%; +} + +.width-87 { + width: 87%; +} + +.width-88 { + width: 88%; +} + +.width-89 { + width: 89%; +} + +.width-90 { + width: 90%; +} + +.width-91 { + width: 91%; +} + +.width-92 { + width: 92%; +} + +.width-93 { + width: 93%; +} + +.width-94 { + width: 94%; +} + +.width-95 { + width: 95%; +} + +.width-96 { + width: 96%; +} + +.width-97 { + width: 97%; +} + +.width-98 { + width: 98%; +} + +.width-99 { + width: 99%; +} + +.width-100 { + width: 100%; +} \ No newline at end of file diff --git a/testy poprawione po mutacyjnym/BMITest.java b/testy poprawione po mutacyjnym/BMITest.java new file mode 100644 index 0000000..434ab56 --- /dev/null +++ b/testy poprawione po mutacyjnym/BMITest.java @@ -0,0 +1,207 @@ +package com.epam.bootcamp.bmi_calculator; + +import static org.junit.Assert.*; + +import org.junit.*; +import org.junit.rules.ExpectedException; + +import com.epam.bootcamp.bmi_calculator.interfacesImplements.MetricBMI; + +public class +BMITest { + + App app; + + /*@Test + public void GuessTheUnitsTest1() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(1.7,50.0); + assertEquals(gtu.getUnitType(),"metric"); + } + + @Test + public void GuessTheUnitsTest2() throws Exception{ + + }*/ + + @Before + public void setup(){ + app = new App(); + } + + @Test + public void BMITest1() throws Exception{ + app.setHeight(1.7); + app.setWeight(50); + assertEquals(app.calculateBMI(),17.3,1); + assertEquals(app.bmiResult(),"Thinness"); + } + + @Test + public void BMITest2() throws Exception{ + try{ + app.setHeight(0); + app.setWeight(50.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + + @Test + public void BMITest3() throws Exception{ + try{ + app.setHeight(1); + app.setWeight(-3); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + + @Test + public void BMITest4() throws Exception{ + try{ + app.setHeight(170); + app.setWeight(1764); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height and weight is in different metric."); + } + } + + @Test + public void BMITest5() throws Exception{ + app.setHeight(170); + app.setWeight(50.0); + assertEquals(app.calculateBMI(),17.3,1); + assertEquals(app.bmiResult(),"Thinness"); + } + + @Test + public void BMITest6() throws Exception{ + app.setHeight(5.58); + app.setWeight(1764); + assertEquals(app.calculateBMI(),17.3,1); + assertEquals(app.bmiResult(),"Thinness"); + } + + @Test + public void BMITest7() throws Exception{ + app.setHeight(86.7); + app.setWeight(6349.3); + assertEquals(app.calculateBMI(),37.19,0.5); + assertEquals(app.bmiResult(),"Heavily overweight"); + } + + @Test + public void BMITest8() throws Exception{ + app.setHeight(6.56); + app.setWeight(220.47); + assertEquals(app.calculateBMI(),25,0.5); + assertEquals(app.bmiResult(),"Overweight"); + } + + @Test + public void BMITest9() throws Exception{ + app.setHeight(200); + app.setWeight(80); + assertEquals(app.calculateBMI(),20,0.0); + assertEquals(app.bmiResult(),"Normal"); + } + @Test + public void BMITest10() throws Exception{ + try{ + app.setHeight(1); + app.setWeight(0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + @Test + public void BMITest11() throws Exception{ + try{ + app.setHeight(0); + app.setWeight(0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + + @Test + public void BMITest12() throws Exception{ + app.setHeight(5.5); + app.setWeight(115); + assertEquals(app.calculateBMI(),18.55945821854913,0.0); + assertEquals(app.bmiResult(),"Normal"); + } + + @Test + public void BMITest13() throws Exception{ + app.setHeight(5.58); + app.setWeight(110.25); + assertEquals(app.calculateBMI(),17.3,1); + assertEquals(app.bmiResult(),"Thinness"); + } + @Test + public void BMITest14() throws Exception { + app.setHeight(65); + app.setWeight(149.5); + assertEquals(app.calculateBMI(), 24.875384615384615, 0.0); + assertEquals(app.bmiResult(), "Normal"); + } + + @Test + public void BMITest15() throws Exception { + app.setHeight(65); + app.setWeight(1780); + assertEquals(app.calculateBMI(), 18.51094674556213, 0.0); + assertEquals(app.bmiResult(), "Normal"); + } + + + @Test + public void BMITest16() throws Exception{ + app.setHeight(6.4); + app.setWeight(252); + assertEquals(app.calculateBMI(),30.035400390624993,0.5); + assertEquals(app.bmiResult(),"Heavily overweight"); + } + + @Test + public void BMITest17() throws Exception { + app.setHeight(65); + app.setWeight(1770); + assertEquals(app.calculateBMI(), 18.406952662721892, 0.0); + assertEquals(app.bmiResult(), "Thinness"); + } + + @Test + public void BMITest18() throws Exception{ + app.setHeight(1.93); + app.setWeight(92.8); + assertEquals(app.calculateBMI(),24.91342049450992,0.0); + assertEquals(app.bmiResult(),"Overweight"); + } + + @Test + public void BMITest19() throws Exception{ + app.setHeight(1.93); + app.setWeight(111.3); + assertEquals(app.calculateBMI(),29.879996778437004,0.0); + assertEquals(app.bmiResult(),"Overweight"); + } + + + @Test + public void BMITest20() throws Exception{ + try{ + app.setHeight(-4); + app.setWeight(50.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } +} \ No newline at end of file diff --git a/testy poprawione po mutacyjnym/GuessTheUnitsTest.java b/testy poprawione po mutacyjnym/GuessTheUnitsTest.java new file mode 100644 index 0000000..7af710e --- /dev/null +++ b/testy poprawione po mutacyjnym/GuessTheUnitsTest.java @@ -0,0 +1,90 @@ +package com.epam.bootcamp.bmi_calculator; + +import static org.junit.Assert.*; + +import org.junit.*; + +public class GuessTheUnitsTest { + + @Test + public void GuessTheUnitsTest1() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(1.7,50.0); + assertEquals(gtu.getUnitType(),"metric"); + } + + @Test + public void GuessTheUnitsTest2() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(170,50.0); + assertEquals(gtu.getUnitType(),"metric"); + } + + @Test + public void GuessTheUnitsTest3() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(5.58,1764); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),110,1); + } + + @Test + public void GuessTheUnitsTest4() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(65,2000); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),125,1); + } + + + @Test + public void GuessTheUnitsTest5() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(100,1000); + assertEquals(gtu.getUnitType(),"metric"); + } + + + @Test + public void GuessTheUnitsTest6() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9.9,3.01); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),3.01,1); + } + + + @Test + public void GuessTheUnitsTest11() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(10,3.01); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),3.01,1); + } + + + @Test + public void GuessTheUnitsTest7() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(2.99,1000); + assertEquals(gtu.getUnitType(),"metric"); + } + + + @Test + public void GuessTheUnitsTest8() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(3,1000); + assertEquals(gtu.getUnitType(),"metric"); + } + + + @Test + public void GuessTheUnitsTest9() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(99.9,1000.1); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),62.50625,0.01); + } + + @Test + public void GuessTheUnitsTest10() throws Exception{ + try{ + GuessTheUnits gtu = new GuessTheUnits(170,1764); + assertEquals(gtu.getUnitType(),"US"); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height and weight is in different metric."); + } + } + +} \ No newline at end of file diff --git a/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html b/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html new file mode 100644 index 0000000..2b7a12c --- /dev/null +++ b/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html @@ -0,0 +1,345 @@ + + + + + + + + + +

MetricBMI.java

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +1 + + + + + + +
package com.epam.bootcamp.bmi_calculator.interfacesImplements;
+ +2 + + + + + + +
+ +3 + + + + + + +
import com.epam.bootcamp.bmi_calculator.interfaces.UnitsInterface;
+ +4 + + + + + + +
+ +5 + + + + + + +
public class MetricBMI implements UnitsInterface{
+ +6 + + + + + + +
	
+ +7 + + + + + + +
	private double bmi;
+ +8 + + + + + + +
	
+ +9 + + + + + + +
	public double getBMI(){
+ +10 + + +1 + + +1. getBMI : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI::getBMI → KILLED
+ +
+
+
		return this.bmi;
+ +11 + + + + + + +
	}
+ +12 + + + + + + +
	
+ +13 + + + + + + +
	public void setBMI(double weight, double height){
+ +14 + + +2 + + +1. setBMI : Replaced double multiplication with division → KILLED
+ +2. setBMI : Replaced double division with multiplication → KILLED
+ +
+
+
		this.bmi = weight/(height*height); //számolja a metrikus BMI-t
+ +15 + + + + + + +
	}
+ +16 + + + + + + +
	
+ +17 + + + + + + +
}

Mutations

10 + + + +

1.1
Location : getBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest19(com.epam.bootcamp.bmi_calculator.BMITest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI::getBMI → KILLED

+
14 + + + +

1.1
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest19(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

2.2
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest19(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double division with multiplication → KILLED

+
+ + +

Active mutators

+ + +

Tests examined

+ + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html b/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html new file mode 100644 index 0000000..830e604 --- /dev/null +++ b/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html @@ -0,0 +1,422 @@ + + + + + + + + + +

UsBMI.java

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +1 + + + + + + +
package com.epam.bootcamp.bmi_calculator.interfacesImplements;
+ +2 + + + + + + +
+ +3 + + + + + + +
import com.epam.bootcamp.bmi_calculator.interfaces.UnitsInterface;
+ +4 + + + + + + +
+ +5 + + + + + + +
public class UsBMI implements UnitsInterface{
+ +6 + + + + + + +
	
+ +7 + + + + + + +
	private static final int usMultiplier = 703;
+ +8 + + + + + + +
	
+ +9 + + + + + + +
	private double bmi;
+ +10 + + + + + + +
	
+ +11 + + + + + + +
	public double getBMI(){
+ +12 + + +1 + + +1. getBMI : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI::getBMI → KILLED
+ +
+
+
		return this.bmi;
+ +13 + + + + + + +
	}
+ +14 + + + + + + +
	
+ +15 + + + + + + +
	/**
+ +16 + + + + + + +
	 * A US mértékegységnél kell konstans, amilve meg kell szorozni a súlyt. Ezt a szorzót a usMultiplier konstans tartalmazza
+ +17 + + + + + + +
	 */
+ +18 + + + + + + +
	public void setBMI(double weight, double height){
+ +19 + + +3 + + +1. setBMI : Replaced double multiplication with division → KILLED
+ +2. setBMI : Replaced double multiplication with division → KILLED
+ +3. setBMI : Replaced double division with multiplication → KILLED
+ +
+
+
		this.bmi = usMultiplier*weight/(height*height); // számolja a US bmi-t
+ +20 + + + + + + +
	}
+ +21 + + + + + + +
	
+ +22 + + + + + + +
}

Mutations

12 + + + +

1.1
Location : getBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI::getBMI → KILLED

+
19 + + + +

1.1
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

2.2
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

3.3
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double division with multiplication → KILLED

+
+ + +

Active mutators

+ + +

Tests examined

+ + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html b/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html new file mode 100644 index 0000000..6da533c --- /dev/null +++ b/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html @@ -0,0 +1,69 @@ + + + + + + + + +

Pit Test Coverage Report

+

Package Summary

+

com.epam.bootcamp.bmi_calculator.interfacesImplements

+ + + + + + + + + + + + + + + + + +
Number of ClassesLine CoverageMutation CoverageTest Strength
2100%
8/8
100%
7/7
100%
7/7
+ + +

Breakdown by Class

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameLine CoverageMutation CoverageTest Strength
MetricBMI.java
100%
4/4
100%
3/3
100%
3/3
UsBMI.java
100%
4/4
100%
4/4
100%
4/4
+
+ + + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator/App.java.html b/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator/App.java.html new file mode 100644 index 0000000..5434775 --- /dev/null +++ b/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator/App.java.html @@ -0,0 +1,1473 @@ + + + + + + + + + +

App.java

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +1 + + + + + + +
package com.epam.bootcamp.bmi_calculator;
+ +2 + + + + + + +
+ +3 + + + + + + +
import com.epam.bootcamp.bmi_calculator.interfacesImplements.*;
+ +4 + + + + + + +
+ +5 + + + + + + +
public class App extends Exception
+ +6 + + + + + + +
{
+ +7 + + + + + + +
+ +8 + + + + + + +
	private double weight;
+ +9 + + + + + + +
	private double height;
+ +10 + + + + + + +
	private double bmi;
+ +11 + + + + + + +
	
+ +12 + + + + + + +
	/**
+ +13 + + + + + + +
	 * A ZeroChecker megnézi, hogy nulla vagy kevesebb-e a súly vagy a magasság.
+ +14 + + + + + + +
	 * Ha valamelyik nulla vagy kevesebb, akkor hibát dob.
+ +15 + + + + + + +
	 */
+ +16 + + + + + + +
	private void ZeroChecker() throws Exception{
+ +17 + + +2 + + +1. ZeroChecker : changed conditional boundary → KILLED
+ +2. ZeroChecker : negated conditional → KILLED
+ +
+
+
		if(this.weight <= 0){
+ +18 + + + + + + +
			throw new Exception("Weight is equals or less than zero.");
+ +19 + + + + + + +
		}
+ +20 + + +2 + + +1. ZeroChecker : changed conditional boundary → SURVIVED
+ +2. ZeroChecker : negated conditional → KILLED
+ +
+
+
		if(this.height <= 0){
+ +21 + + + + + + +
			throw new Exception("Height is equals or less than zero.");
+ +22 + + + + + + +
		}	
+ +23 + + + + + + +
	}
+ +24 + + + + + + +
	
+ +25 + + + + + + +
	/**
+ +26 + + + + + + +
	 * Ez adja értéknek a BMI-t a bmi változónak.
+ +27 + + + + + + +
	 * Először megnézi a ZeroCheckerrel a kapott értékeket.
+ +28 + + + + + + +
	 * Meghívja a GuessTheUnits osztályt, ami kitalálja, hogy milyen mértékegységekkel számoljuk a BMI-t(US vagy metric).
+ +29 + + + + + + +
	 * Attól függően, hogy mi a mértékegység, hívjuk meg a számolót.
+ +30 + + + + + + +
	 * @return a bmi értékével tér vissza a metódus
+ +31 + + + + + + +
	 * @throws Exception
+ +32 + + + + + + +
	 */
+ +33 + + + + + + +
	public double calculateBMI() throws Exception{ //végül kiszámoljuk a BMI-t
+ +34 + + +1 + + +1. calculateBMI : removed call to com/epam/bootcamp/bmi_calculator/App::ZeroChecker → SURVIVED
+ +
+
+
		ZeroChecker();
+ +35 + + + + + + +
		GuessTheUnits gtu = new GuessTheUnits(this.height, this.weight);
+ +36 + + +1 + + +1. calculateBMI : negated conditional → KILLED
+ +
+
+
		if(gtu.getUnitType().equals("US")){
+ +37 + + + + + + +
			UsBMI ubmi = new UsBMI();
+ +38 + + +1 + + +1. calculateBMI : removed call to com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI::setBMI → KILLED
+ +
+
+
			ubmi.setBMI(gtu.getWeight(), gtu.getHeight());
+ +39 + + + + + + +
			this.bmi = ubmi.getBMI();
+ +40 + + +1 + + +1. calculateBMI : negated conditional → KILLED
+ +
+
+
		}else if(gtu.getUnitType().equals("metric")){
+ +41 + + + + + + +
			MetricBMI mbmi = new MetricBMI();
+ +42 + + +1 + + +1. calculateBMI : removed call to com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI::setBMI → KILLED
+ +
+
+
			mbmi.setBMI(gtu.getWeight(), gtu.getHeight());
+ +43 + + + + + + +
			this.bmi = mbmi.getBMI();
+ +44 + + + + + + +
		}
+ +45 + + +1 + + +1. calculateBMI : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/App::calculateBMI → KILLED
+ +
+
+
		return this.bmi;
+ +46 + + + + + + +
	}
+ +47 + + + + + + +
	
+ +48 + + + + + + +
	/**
+ +49 + + + + + + +
	 * A bmi változó értékétől függően kapjuk meg az adott ember értékelését
+ +50 + + + + + + +
	 * @return Egy string, ami tartalmazza az értékelést
+ +51 + + + + + + +
	 */
+ +52 + + + + + + +
	public String bmiResult(){
+ +53 + + +2 + + +1. bmiResult : changed conditional boundary → SURVIVED
+ +2. bmiResult : negated conditional → KILLED
+ +
+
+
		if(this.bmi < 18.5){ // Sovány
+ +54 + + +1 + + +1. bmiResult : replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED
+ +
+
+
			return "Thinness";
+ +55 + + +4 + + +1. bmiResult : changed conditional boundary → SURVIVED
+ +2. bmiResult : changed conditional boundary → SURVIVED
+ +3. bmiResult : negated conditional → KILLED
+ +4. bmiResult : negated conditional → KILLED
+ +
+
+
		}else if(this.bmi >= 18.5 && this.bmi <= 24.9){ // Normál testalkatú
+ +56 + + +1 + + +1. bmiResult : replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED
+ +
+
+
			return "Normal";
+ +57 + + +4 + + +1. bmiResult : changed conditional boundary → SURVIVED
+ +2. bmiResult : changed conditional boundary → SURVIVED
+ +3. bmiResult : negated conditional → KILLED
+ +4. bmiResult : negated conditional → KILLED
+ +
+
+
		}else if(this.bmi > 24.9 && this.bmi <= 29.9){ // Túlsúlyos
+ +58 + + +1 + + +1. bmiResult : replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED
+ +
+
+
			return "Overweight";
+ +59 + + + + + + +
		}else{ // Erősen túlsúlyos
+ +60 + + +1 + + +1. bmiResult : replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED
+ +
+
+
			return "Heavily overweight";
+ +61 + + + + + + +
		}
+ +62 + + + + + + +
	}
+ +63 + + + + + + +
	
+ +64 + + + + + + +
	/**
+ +65 + + + + + + +
	 * Súly beállítása
+ +66 + + + + + + +
	 * @param weight a súly
+ +67 + + + + + + +
	 */
+ +68 + + + + + + +
	public void setWeight(double weight){
+ +69 + + + + + + +
		this.weight = weight;
+ +70 + + + + + + +
	}
+ +71 + + + + + + +
	
+ +72 + + + + + + +
	/**
+ +73 + + + + + + +
	 * Magasság beállítása
+ +74 + + + + + + +
	 * @param height a magasság
+ +75 + + + + + + +
	 */
+ +76 + + + + + + +
	public void setHeight(double height){
+ +77 + + + + + + +
		this.height = height;
+ +78 + + + + + + +
	}
+ +79 + + + + + + +
}

Mutations

17 + + + +

1.1
Location : ZeroChecker
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest11(com.epam.bootcamp.bmi_calculator.BMITest)
changed conditional boundary → KILLED

2.2
Location : ZeroChecker
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest20(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
20 + + + +

1.1
Location : ZeroChecker
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : ZeroChecker
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest4(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
34 + + + +

1.1
Location : calculateBMI
Killed by : none
removed call to com/epam/bootcamp/bmi_calculator/App::ZeroChecker → SURVIVED

+
36 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
38 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
removed call to com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI::setBMI → KILLED

+
40 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest19(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
42 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest19(com.epam.bootcamp.bmi_calculator.BMITest)
removed call to com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI::setBMI → KILLED

+
45 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/App::calculateBMI → KILLED

+
53 + + + +

1.1
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
54 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED

+
55 + + + +

1.1
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

3.3
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest14(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

4.4
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest14(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
56 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest14(com.epam.bootcamp.bmi_calculator.BMITest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED

+
57 + + + +

1.1
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

3.3
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest19(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

4.4
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest19(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
58 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest19(com.epam.bootcamp.bmi_calculator.BMITest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED

+
60 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest7(com.epam.bootcamp.bmi_calculator.BMITest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED

+
+ + +

Active mutators

+ + +

Tests examined

+ + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html b/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html new file mode 100644 index 0000000..de99c4b --- /dev/null +++ b/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html @@ -0,0 +1,1900 @@ + + + + + + + + + +

GuessTheUnits.java

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +1 + + + + + + +
package com.epam.bootcamp.bmi_calculator;
+ +2 + + + + + + +
+ +3 + + + + + + +
public class GuessTheUnits{
+ +4 + + + + + + +
+ +5 + + + + + + +
	private double height;
+ +6 + + + + + + +
	private double weight;	
+ +7 + + + + + + +
	private String unitType;
+ +8 + + + + + + +
	
+ +9 + + + + + + +
	
+ +10 + + + + + + +
	/**
+ +11 + + + + + + +
	 * Váltószám konstansok
+ +12 + + + + + + +
	 */
+ +13 + + + + + + +
	private static final double ouncesToPounds = 0.0625;
+ +14 + + + + + + +
	private static final double centimeterToMeter = 100;
+ +15 + + + + + + +
	private static final double feetToInch = 12;
+ +16 + + + + + + +
	
+ +17 + + + + + + +
	public GuessTheUnits(double height, double weight) throws Exception{
+ +18 + + + + + + +
		this.height = height;
+ +19 + + + + + + +
		this.weight = weight;
+ +20 + + +1 + + +1. <init> : removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::guessUnit → KILLED
+ +
+
+
		guessUnit();
+ +21 + + + + + + +
	}
+ +22 + + + + + + +
	
+ +23 + + + + + + +
	/**
+ +24 + + + + + + +
	 * A mértékegység megállapító metódus.
+ +25 + + + + + + +
	 * Ha a magasság kisebb száznál, és azon belül 10 és 3 között van, akkor feetben kaptuk a magasságot.
+ +26 + + + + + + +
	 * Ha a magasság kisebb száznál, de nagyobb vagy egyenlő 10-el, akkor inchben.
+ +27 + + + + + + +
	 * Ha a magasság kisebb vagy egyenlő 3-al, akkor méterben.
+ +28 + + + + + + +
	 * Ha a magasság nagyobb száznál, akkor pedig centiméterben.
+ +29 + + + + + + +
	 * 
+ +30 + + + + + + +
	 * A magasság alapján meg tudjuk mondani, hogy milyen mértékegységben kaphattuk a súlyt.
+ +31 + + + + + + +
	 * Ha US mértékegységet használunk és a súly nagyobb mint ezer, akkor ounces-ban kaptuk meg a súlyt.
+ +32 + + + + + + +
	 * Ha metrikus mértékegységet használunk, és a súly nagyobb mint ezer, valószínűleg két különböző mértékegységben
+ +33 + + + + + + +
	 * kaptuk meg a magasságot és a súlyt, ezért hibát dob.
+ +34 + + + + + + +
	 * 
+ +35 + + + + + + +
	 * Ha feetben, centiméterben vagy ounces-ban kaptuk valamelyik értéket, a convertUnit metódussal át kell alakítanunk azt.
+ +36 + + + + + + +
	 * @throws Exception
+ +37 + + + + + + +
	 */
+ +38 + + + + + + +
	private void guessUnit() throws Exception{ // kitaláljuk a mértékegységet
+ +39 + + +2 + + +1. guessUnit : changed conditional boundary → KILLED
+ +2. guessUnit : negated conditional → KILLED
+ +
+
+
		if(this.height < 100){
+ +40 + + +4 + + +1. guessUnit : changed conditional boundary → SURVIVED
+ +2. guessUnit : changed conditional boundary → KILLED
+ +3. guessUnit : negated conditional → KILLED
+ +4. guessUnit : negated conditional → KILLED
+ +
+
+
			if(this.height < 10 && this.height > 3){ // feet
+ +41 + + +1 + + +1. guessUnit : removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED
+ +
+
+
				convertUnit("feet"); //átkonvertáljuk inch-re
+ +42 + + + + + + +
				this.unitType = "US";
+ +43 + + +2 + + +1. guessUnit : changed conditional boundary → KILLED
+ +2. guessUnit : negated conditional → KILLED
+ +
+
+
			}else if(this.height >= 10){ // inch
+ +44 + + + + + + +
				this.unitType = "US";
+ +45 + + + + + + +
			}else{ // meter
+ +46 + + + + + + +
				this.unitType = "metric";
+ +47 + + + + + + +
			}
+ +48 + + + + + + +
		}else{ // centimeter
+ +49 + + +1 + + +1. guessUnit : removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED
+ +
+
+
			convertUnit("centimeter"); //átkonvertáljuk méterre
+ +50 + + + + + + +
			this.unitType = "metric";
+ +51 + + + + + + +
		}
+ +52 + + + + + + +
		
+ +53 + + +1 + + +1. guessUnit : negated conditional → KILLED
+ +
+
+
		if(this.unitType.equals("US")){ // ounces
+ +54 + + +2 + + +1. guessUnit : changed conditional boundary → SURVIVED
+ +2. guessUnit : negated conditional → KILLED
+ +
+
+
			if(this.weight > 1000){
+ +55 + + +1 + + +1. guessUnit : removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED
+ +
+
+
				convertUnit("ounces"); //átkonvertáljuk fontra
+ +56 + + + + + + +
			}
+ +57 + + + + + + +
		}else{
+ +58 + + +2 + + +1. guessUnit : changed conditional boundary → KILLED
+ +2. guessUnit : negated conditional → KILLED
+ +
+
+
			if(this.weight > 1000){
+ +59 + + + + + + +
				throw new Exception("Height and weight is in different metric.");
+ +60 + + + + + + +
			}
+ +61 + + + + + + +
		}
+ +62 + + + + + + +
	}
+ +63 + + + + + + +
	
+ +64 + + + + + + +
	
+ +65 + + + + + + +
	/**
+ +66 + + + + + + +
	 * Átváltja a mértékegységeket egységesre.
+ +67 + + + + + + +
	 * @param unit
+ +68 + + + + + + +
	 */
+ +69 + + + + + + +
	private void convertUnit(String unit){
+ +70 + + +1 + + +1. convertUnit : negated conditional → KILLED
+ +
+
+
		if(unit.equals("ounces")){
+ +71 + + +1 + + +1. convertUnit : Replaced double multiplication with division → KILLED
+ +
+
+
			this.weight = this.weight * ouncesToPounds;
+ +72 + + + + + + +
		}
+ +73 + + +1 + + +1. convertUnit : negated conditional → KILLED
+ +
+
+
		if(unit.equals("feet")){
+ +74 + + +1 + + +1. convertUnit : Replaced double multiplication with division → KILLED
+ +
+
+
			this.height = this.height * feetToInch;
+ +75 + + + + + + +
		}
+ +76 + + +1 + + +1. convertUnit : negated conditional → KILLED
+ +
+
+
		if(unit.equals("centimeter")){
+ +77 + + +1 + + +1. convertUnit : Replaced double division with multiplication → KILLED
+ +
+
+
			this.height = this.height / centimeterToMeter;
+ +78 + + + + + + +
		}
+ +79 + + + + + + +
	}
+ +80 + + + + + + +
	
+ +81 + + + + + + +
	/**
+ +82 + + + + + + +
	 * Súly getter
+ +83 + + + + + + +
	 * @return a súly
+ +84 + + + + + + +
	 */
+ +85 + + + + + + +
	public double getWeight(){
+ +86 + + +1 + + +1. getWeight : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getWeight → KILLED
+ +
+
+
		return this.weight;
+ +87 + + + + + + +
	}
+ +88 + + + + + + +
	
+ +89 + + + + + + +
	/**
+ +90 + + + + + + +
	 * Magasság getter
+ +91 + + + + + + +
	 * @return magasság
+ +92 + + + + + + +
	 */
+ +93 + + + + + + +
	public double getHeight(){
+ +94 + + +1 + + +1. getHeight : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getHeight → KILLED
+ +
+
+
		return this.height;
+ +95 + + + + + + +
	}
+ +96 + + + + + + +
	
+ +97 + + + + + + +
	/**
+ +98 + + + + + + +
	 * A mértékegység típusa getter
+ +99 + + + + + + +
	 * @return mértékegység típusa
+ +100 + + + + + + +
	 */
+ +101 + + + + + + +
	public String getUnitType(){
+ +102 + + +1 + + +1. getUnitType : replaced return value with "" for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getUnitType → KILLED
+ +
+
+
		return this.unitType;
+ +103 + + + + + + +
	}
+ +104 + + + + + + +
}

Mutations

20 + + + +

1.1
Location : <init>
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest7(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::guessUnit → KILLED

+
39 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest5(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
changed conditional boundary → KILLED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest11(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
40 + + + +

1.1
Location : guessUnit
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest8(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
changed conditional boundary → KILLED

3.3
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest3(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

4.4
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest7(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
41 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED

+
43 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest11(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
changed conditional boundary → KILLED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest7(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
49 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED

+
53 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest10(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
54 + + + +

1.1
Location : guessUnit
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest11(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
55 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest3(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED

+
58 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest7(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
changed conditional boundary → KILLED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest7(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
70 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest10(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
71 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest3(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
Replaced double multiplication with division → KILLED

+
73 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
74 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

+
76 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
77 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double division with multiplication → KILLED

+
86 + + + +

1.1
Location : getWeight
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest11(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getWeight → KILLED

+
94 + + + +

1.1
Location : getHeight
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getHeight → KILLED

+
102 + + + +

1.1
Location : getUnitType
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest7(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getUnitType → KILLED

+
+ + +

Active mutators

+ + +

Tests examined

+ + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator/index.html b/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator/index.html new file mode 100644 index 0000000..cdef783 --- /dev/null +++ b/testy poprawione po mutacyjnym/raport/com.epam.bootcamp.bmi_calculator/index.html @@ -0,0 +1,69 @@ + + + + + + + + +

Pit Test Coverage Report

+

Package Summary

+

com.epam.bootcamp.bmi_calculator

+ + + + + + + + + + + + + + + + + +
Number of ClassesLine CoverageMutation CoverageTest Strength
2100%
58/58
82%
41/50
82%
41/50
+ + +

Breakdown by Class

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameLine CoverageMutation CoverageTest Strength
App.java
100%
28/28
71%
17/24
71%
17/24
GuessTheUnits.java
100%
30/30
92%
24/26
92%
24/26
+
+ + + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy poprawione po mutacyjnym/raport/index.html b/testy poprawione po mutacyjnym/raport/index.html new file mode 100644 index 0000000..2b1a93f --- /dev/null +++ b/testy poprawione po mutacyjnym/raport/index.html @@ -0,0 +1,72 @@ + + + + + + + + +

Pit Test Coverage Report

+ +

Project Summary

+ + + + + + + + + + + + + + + + + +
Number of ClassesLine CoverageMutation CoverageTest Strength
4100%
66/66
84%
48/57
84%
48/57
+ + +

Breakdown by Package

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameNumber of ClassesLine CoverageMutation CoverageTest Strength
com.epam.bootcamp.bmi_calculator2
100%
58/58
82%
41/50
82%
41/50
com.epam.bootcamp.bmi_calculator.interfacesImplements2
100%
8/8
100%
7/7
100%
7/7
+
+ + + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy poprawione po mutacyjnym/raport/style.css b/testy poprawione po mutacyjnym/raport/style.css new file mode 100644 index 0000000..303bfba --- /dev/null +++ b/testy poprawione po mutacyjnym/raport/style.css @@ -0,0 +1,563 @@ +html, body, div, span, p, blockquote, pre { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +body{ + line-height: 1; + color: black; + background: white; + margin-left: 20px; +} + +.src { + border: 1px solid #dddddd; + padding-top: 10px; + padding-right: 5px; + padding-left: 5px; + font-family: Consolas, Courier, monospace; +} + +.covered, .COVERED { + background-color: #ddffdd; +} + +.uncovered, .UNCOVERED { + background-color: #ffdddd; +} + +.killed, .KILLED { + background-color: #aaffaa; +} + +.survived, .SURVIVED { + background-color: #ffaaaa; +} + +.uncertain, .UNCERTAIN { + background-color: #dde7ef; +} + +.run_error, .RUN_ERROR { + background-color: #dde7ef; +} + +.na { + background-color: #eeeeee; +} + +.timed_out, .TIMED_OUT { + background-color: #dde7ef; +} + +.non_viable, .NON_VIABLE { + background-color: #aaffaa; +} + +.memory_error, .MEMORY_ERROR { + background-color: #dde7ef; +} + +.not_started, .NO_STARTED { + background-color: #dde7ef; color : red +} + +.no_coverage, .NO_COVERAGE { + background-color: #ffaaaa; +} + +.tests { + width: 50%; + float: left; +} + +.mutees { + float: right; + width: 50%; +} + +.unit { + padding-top: 20px; + clear: both; +} + +.coverage_bar { + display: inline-block; + height: 1.1em; + width: 130px; + background: #FAA; + margin: 0 5px; + vertical-align: middle; + border: 1px solid #AAA; + position: relative; +} + +.coverage_complete { + display: inline-block; + height: 100%; + background: #DFD; + float: left; +} + +.coverage_legend { + position: absolute; + height: 100%; + width: 100%; + left: 0; + top: 0; + text-align: center; +} + +.line, .mut { + vertical-align: middle; +} + +.coverage_percentage { + display: inline-block; + width: 3em; + text-align: right; +} + +.pop { + outline:none; +} + +.pop strong { + line-height: 30px; +} + +.pop { + text-decoration: none; +} + +.pop span { + z-index: 10; + display: none; + padding: 14px 20px; + margin-top: -30px; + margin-left: 28px; + width: 800px; + line-height: 16px; + word-wrap: break-word; + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -moz-box-shadow: 5px 5px 8px #CCC; + -webkit-box-shadow: 5px 5px 8px #CCC; + box-shadow: 5px 5px 8px #CCC; +} + +.pop:hover span { + display: inline; + position: absolute; + color: #111; + border: 1px solid #DCA; + background: #fffAF0; +} + +.width-1 { + width: 1%; +} + +.width-2 { + width: 2%; +} + +.width-3 { + width: 3%; +} + +.width-4 { + width: 4%; +} + +.width-5 { + width: 5%; +} + +.width-6 { + width: 6%; +} + +.width-7 { + width: 7%; +} + +.width-8 { + width: 8%; +} + +.width-9 { + width: 9%; +} + +.width-10 { + width: 10%; +} + +.width-11 { + width: 11%; +} + +.width-12 { + width: 12%; +} + +.width-13 { + width: 13%; +} + +.width-14 { + width: 14%; +} + +.width-15 { + width: 15%; +} + +.width-16 { + width: 16%; +} + +.width-17 { + width: 17%; +} + +.width-18 { + width: 18%; +} + +.width-19 { + width: 19%; +} + +.width-20 { + width: 20%; +} + +.width-21 { + width: 21%; +} + +.width-22 { + width: 22%; +} + +.width-23 { + width: 23%; +} + +.width-24 { + width: 24%; +} + +.width-25 { + width: 25%; +} + +.width-26 { + width: 26%; +} + +.width-27 { + width: 27%; +} + +.width-28 { + width: 28%; +} + +.width-29 { + width: 29%; +} + +.width-30 { + width: 30%; +} + +.width-31 { + width: 31%; +} + +.width-32 { + width: 32%; +} + +.width-33 { + width: 33%; +} + +.width-34 { + width: 34%; +} + +.width-35 { + width: 35%; +} + +.width-36 { + width: 36%; +} + +.width-37 { + width: 37%; +} + +.width-38 { + width: 38%; +} + +.width-39 { + width: 39%; +} + +.width-40 { + width: 40%; +} + +.width-41 { + width: 41%; +} + +.width-42 { + width: 42%; +} + +.width-43 { + width: 43%; +} + +.width-44 { + width: 44%; +} + +.width-45 { + width: 45%; +} + +.width-46 { + width: 46%; +} + +.width-47 { + width: 47%; +} + +.width-48 { + width: 48%; +} + +.width-49 { + width: 49%; +} + +.width-50 { + width: 50%; +} + +.width-51 { + width: 51%; +} + +.width-52 { + width: 52%; +} + +.width-53 { + width: 53%; +} + +.width-54 { + width: 54%; +} + +.width-55 { + width: 55%; +} + +.width-56 { + width: 56%; +} + +.width-57 { + width: 57%; +} + +.width-58 { + width: 58%; +} + +.width-59 { + width: 59%; +} + +.width-60 { + width: 60%; +} + +.width-61 { + width: 61%; +} + +.width-62 { + width: 62%; +} + +.width-63 { + width: 63%; +} + +.width-64 { + width: 64%; +} + +.width-65 { + width: 65%; +} + +.width-66 { + width: 66%; +} + +.width-67 { + width: 67%; +} + +.width-68 { + width: 68%; +} + +.width-69 { + width: 69%; +} + +.width-70 { + width: 70%; +} + +.width-71 { + width: 71%; +} + +.width-72 { + width: 72%; +} + +.width-73 { + width: 73%; +} + +.width-74 { + width: 74%; +} + +.width-75 { + width: 75%; +} + +.width-76 { + width: 76%; +} + +.width-77 { + width: 77%; +} + +.width-78 { + width: 78%; +} + +.width-79 { + width: 79%; +} + +.width-80 { + width: 80%; +} + +.width-81 { + width: 81%; +} + +.width-82 { + width: 82%; +} + +.width-83 { + width: 83%; +} + +.width-84 { + width: 84%; +} + +.width-85 { + width: 85%; +} + +.width-86 { + width: 86%; +} + +.width-87 { + width: 87%; +} + +.width-88 { + width: 88%; +} + +.width-89 { + width: 89%; +} + +.width-90 { + width: 90%; +} + +.width-91 { + width: 91%; +} + +.width-92 { + width: 92%; +} + +.width-93 { + width: 93%; +} + +.width-94 { + width: 94%; +} + +.width-95 { + width: 95%; +} + +.width-96 { + width: 96%; +} + +.width-97 { + width: 97%; +} + +.width-98 { + width: 98%; +} + +.width-99 { + width: 99%; +} + +.width-100 { + width: 100%; +} \ No newline at end of file diff --git a/testy uzupełnione/BMITest.java b/testy uzupełnione/BMITest.java new file mode 100644 index 0000000..434ab56 --- /dev/null +++ b/testy uzupełnione/BMITest.java @@ -0,0 +1,207 @@ +package com.epam.bootcamp.bmi_calculator; + +import static org.junit.Assert.*; + +import org.junit.*; +import org.junit.rules.ExpectedException; + +import com.epam.bootcamp.bmi_calculator.interfacesImplements.MetricBMI; + +public class +BMITest { + + App app; + + /*@Test + public void GuessTheUnitsTest1() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(1.7,50.0); + assertEquals(gtu.getUnitType(),"metric"); + } + + @Test + public void GuessTheUnitsTest2() throws Exception{ + + }*/ + + @Before + public void setup(){ + app = new App(); + } + + @Test + public void BMITest1() throws Exception{ + app.setHeight(1.7); + app.setWeight(50); + assertEquals(app.calculateBMI(),17.3,1); + assertEquals(app.bmiResult(),"Thinness"); + } + + @Test + public void BMITest2() throws Exception{ + try{ + app.setHeight(0); + app.setWeight(50.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + + @Test + public void BMITest3() throws Exception{ + try{ + app.setHeight(1); + app.setWeight(-3); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + + @Test + public void BMITest4() throws Exception{ + try{ + app.setHeight(170); + app.setWeight(1764); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height and weight is in different metric."); + } + } + + @Test + public void BMITest5() throws Exception{ + app.setHeight(170); + app.setWeight(50.0); + assertEquals(app.calculateBMI(),17.3,1); + assertEquals(app.bmiResult(),"Thinness"); + } + + @Test + public void BMITest6() throws Exception{ + app.setHeight(5.58); + app.setWeight(1764); + assertEquals(app.calculateBMI(),17.3,1); + assertEquals(app.bmiResult(),"Thinness"); + } + + @Test + public void BMITest7() throws Exception{ + app.setHeight(86.7); + app.setWeight(6349.3); + assertEquals(app.calculateBMI(),37.19,0.5); + assertEquals(app.bmiResult(),"Heavily overweight"); + } + + @Test + public void BMITest8() throws Exception{ + app.setHeight(6.56); + app.setWeight(220.47); + assertEquals(app.calculateBMI(),25,0.5); + assertEquals(app.bmiResult(),"Overweight"); + } + + @Test + public void BMITest9() throws Exception{ + app.setHeight(200); + app.setWeight(80); + assertEquals(app.calculateBMI(),20,0.0); + assertEquals(app.bmiResult(),"Normal"); + } + @Test + public void BMITest10() throws Exception{ + try{ + app.setHeight(1); + app.setWeight(0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + @Test + public void BMITest11() throws Exception{ + try{ + app.setHeight(0); + app.setWeight(0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + + @Test + public void BMITest12() throws Exception{ + app.setHeight(5.5); + app.setWeight(115); + assertEquals(app.calculateBMI(),18.55945821854913,0.0); + assertEquals(app.bmiResult(),"Normal"); + } + + @Test + public void BMITest13() throws Exception{ + app.setHeight(5.58); + app.setWeight(110.25); + assertEquals(app.calculateBMI(),17.3,1); + assertEquals(app.bmiResult(),"Thinness"); + } + @Test + public void BMITest14() throws Exception { + app.setHeight(65); + app.setWeight(149.5); + assertEquals(app.calculateBMI(), 24.875384615384615, 0.0); + assertEquals(app.bmiResult(), "Normal"); + } + + @Test + public void BMITest15() throws Exception { + app.setHeight(65); + app.setWeight(1780); + assertEquals(app.calculateBMI(), 18.51094674556213, 0.0); + assertEquals(app.bmiResult(), "Normal"); + } + + + @Test + public void BMITest16() throws Exception{ + app.setHeight(6.4); + app.setWeight(252); + assertEquals(app.calculateBMI(),30.035400390624993,0.5); + assertEquals(app.bmiResult(),"Heavily overweight"); + } + + @Test + public void BMITest17() throws Exception { + app.setHeight(65); + app.setWeight(1770); + assertEquals(app.calculateBMI(), 18.406952662721892, 0.0); + assertEquals(app.bmiResult(), "Thinness"); + } + + @Test + public void BMITest18() throws Exception{ + app.setHeight(1.93); + app.setWeight(92.8); + assertEquals(app.calculateBMI(),24.91342049450992,0.0); + assertEquals(app.bmiResult(),"Overweight"); + } + + @Test + public void BMITest19() throws Exception{ + app.setHeight(1.93); + app.setWeight(111.3); + assertEquals(app.calculateBMI(),29.879996778437004,0.0); + assertEquals(app.bmiResult(),"Overweight"); + } + + + @Test + public void BMITest20() throws Exception{ + try{ + app.setHeight(-4); + app.setWeight(50.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } +} \ No newline at end of file diff --git a/testy uzupełnione/GuessTheUnitsTest.java b/testy uzupełnione/GuessTheUnitsTest.java new file mode 100644 index 0000000..624efa5 --- /dev/null +++ b/testy uzupełnione/GuessTheUnitsTest.java @@ -0,0 +1,82 @@ +package com.epam.bootcamp.bmi_calculator; + +import static org.junit.Assert.*; + +import org.junit.*; + +public class GuessTheUnitsTest { + + @Test + public void GuessTheUnitsTest1() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(1.7,50.0); + assertEquals(gtu.getUnitType(),"metric"); + } + + @Test + public void GuessTheUnitsTest2() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(170,50.0); + assertEquals(gtu.getUnitType(),"metric"); + } + + @Test + public void GuessTheUnitsTest3() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(5.58,1764); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),110,1); + } + + @Test + public void GuessTheUnitsTest4() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(65,2000); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),125,1); + } + + + @Test + public void GuessTheUnitsTest5() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(100,1000); + assertEquals(gtu.getUnitType(),"metric"); + } + + + @Test + public void GuessTheUnitsTest6() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9.9,3.01); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),3.01,1); + } + + + @Test + public void GuessTheUnitsTest7() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(2.99,1000); + assertEquals(gtu.getUnitType(),"metric"); + } + + + @Test + public void GuessTheUnitsTest8() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(3,1000); + assertEquals(gtu.getUnitType(),"metric"); + } + + + @Test + public void GuessTheUnitsTest9() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(99.9,1000.1); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),62.50625,0.01); + } + + @Test + public void GuessTheUnitsTest10() throws Exception{ + try{ + GuessTheUnits gtu = new GuessTheUnits(170,1764); + assertEquals(gtu.getUnitType(),"US"); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height and weight is in different metric."); + } + } + +} \ No newline at end of file diff --git a/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html b/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html new file mode 100644 index 0000000..eb6ad3f --- /dev/null +++ b/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html @@ -0,0 +1,345 @@ + + + + + + + + + +

MetricBMI.java

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +1 + + + + + + +
package com.epam.bootcamp.bmi_calculator.interfacesImplements;
+ +2 + + + + + + +
+ +3 + + + + + + +
import com.epam.bootcamp.bmi_calculator.interfaces.UnitsInterface;
+ +4 + + + + + + +
+ +5 + + + + + + +
public class MetricBMI implements UnitsInterface{
+ +6 + + + + + + +
	
+ +7 + + + + + + +
	private double bmi;
+ +8 + + + + + + +
	
+ +9 + + + + + + +
	public double getBMI(){
+ +10 + + +1 + + +1. getBMI : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI::getBMI → KILLED
+ +
+
+
		return this.bmi;
+ +11 + + + + + + +
	}
+ +12 + + + + + + +
	
+ +13 + + + + + + +
	public void setBMI(double weight, double height){
+ +14 + + +2 + + +1. setBMI : Replaced double multiplication with division → KILLED
+ +2. setBMI : Replaced double division with multiplication → KILLED
+ +
+
+
		this.bmi = weight/(height*height); //számolja a metrikus BMI-t
+ +15 + + + + + + +
	}
+ +16 + + + + + + +
	
+ +17 + + + + + + +
}

Mutations

10 + + + +

1.1
Location : getBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI::getBMI → KILLED

+
14 + + + +

1.1
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

2.2
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double division with multiplication → KILLED

+
+ + +

Active mutators

+ + +

Tests examined

+ + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html b/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html new file mode 100644 index 0000000..d2b4e3d --- /dev/null +++ b/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html @@ -0,0 +1,422 @@ + + + + + + + + + +

UsBMI.java

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +1 + + + + + + +
package com.epam.bootcamp.bmi_calculator.interfacesImplements;
+ +2 + + + + + + +
+ +3 + + + + + + +
import com.epam.bootcamp.bmi_calculator.interfaces.UnitsInterface;
+ +4 + + + + + + +
+ +5 + + + + + + +
public class UsBMI implements UnitsInterface{
+ +6 + + + + + + +
	
+ +7 + + + + + + +
	private static final int usMultiplier = 703;
+ +8 + + + + + + +
	
+ +9 + + + + + + +
	private double bmi;
+ +10 + + + + + + +
	
+ +11 + + + + + + +
	public double getBMI(){
+ +12 + + +1 + + +1. getBMI : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI::getBMI → KILLED
+ +
+
+
		return this.bmi;
+ +13 + + + + + + +
	}
+ +14 + + + + + + +
	
+ +15 + + + + + + +
	/**
+ +16 + + + + + + +
	 * A US mértékegységnél kell konstans, amilve meg kell szorozni a súlyt. Ezt a szorzót a usMultiplier konstans tartalmazza
+ +17 + + + + + + +
	 */
+ +18 + + + + + + +
	public void setBMI(double weight, double height){
+ +19 + + +3 + + +1. setBMI : Replaced double multiplication with division → KILLED
+ +2. setBMI : Replaced double multiplication with division → KILLED
+ +3. setBMI : Replaced double division with multiplication → KILLED
+ +
+
+
		this.bmi = usMultiplier*weight/(height*height); // számolja a US bmi-t
+ +20 + + + + + + +
	}
+ +21 + + + + + + +
	
+ +22 + + + + + + +
}

Mutations

12 + + + +

1.1
Location : getBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI::getBMI → KILLED

+
19 + + + +

1.1
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

2.2
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

3.3
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double division with multiplication → KILLED

+
+ + +

Active mutators

+ + +

Tests examined

+ + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html b/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html new file mode 100644 index 0000000..6da533c --- /dev/null +++ b/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html @@ -0,0 +1,69 @@ + + + + + + + + +

Pit Test Coverage Report

+

Package Summary

+

com.epam.bootcamp.bmi_calculator.interfacesImplements

+ + + + + + + + + + + + + + + + + +
Number of ClassesLine CoverageMutation CoverageTest Strength
2100%
8/8
100%
7/7
100%
7/7
+ + +

Breakdown by Class

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameLine CoverageMutation CoverageTest Strength
MetricBMI.java
100%
4/4
100%
3/3
100%
3/3
UsBMI.java
100%
4/4
100%
4/4
100%
4/4
+
+ + + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator/App.java.html b/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator/App.java.html new file mode 100644 index 0000000..d464f43 --- /dev/null +++ b/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator/App.java.html @@ -0,0 +1,1473 @@ + + + + + + + + + +

App.java

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +1 + + + + + + +
package com.epam.bootcamp.bmi_calculator;
+ +2 + + + + + + +
+ +3 + + + + + + +
import com.epam.bootcamp.bmi_calculator.interfacesImplements.*;
+ +4 + + + + + + +
+ +5 + + + + + + +
public class App extends Exception
+ +6 + + + + + + +
{
+ +7 + + + + + + +
+ +8 + + + + + + +
	private double weight;
+ +9 + + + + + + +
	private double height;
+ +10 + + + + + + +
	private double bmi;
+ +11 + + + + + + +
	
+ +12 + + + + + + +
	/**
+ +13 + + + + + + +
	 * A ZeroChecker megnézi, hogy nulla vagy kevesebb-e a súly vagy a magasság.
+ +14 + + + + + + +
	 * Ha valamelyik nulla vagy kevesebb, akkor hibát dob.
+ +15 + + + + + + +
	 */
+ +16 + + + + + + +
	private void ZeroChecker() throws Exception{
+ +17 + + +2 + + +1. ZeroChecker : changed conditional boundary → KILLED
+ +2. ZeroChecker : negated conditional → KILLED
+ +
+
+
		if(this.weight <= 0){
+ +18 + + + + + + +
			throw new Exception("Weight is equals or less than zero.");
+ +19 + + + + + + +
		}
+ +20 + + +2 + + +1. ZeroChecker : changed conditional boundary → SURVIVED
+ +2. ZeroChecker : negated conditional → KILLED
+ +
+
+
		if(this.height <= 0){
+ +21 + + + + + + +
			throw new Exception("Height is equals or less than zero.");
+ +22 + + + + + + +
		}	
+ +23 + + + + + + +
	}
+ +24 + + + + + + +
	
+ +25 + + + + + + +
	/**
+ +26 + + + + + + +
	 * Ez adja értéknek a BMI-t a bmi változónak.
+ +27 + + + + + + +
	 * Először megnézi a ZeroCheckerrel a kapott értékeket.
+ +28 + + + + + + +
	 * Meghívja a GuessTheUnits osztályt, ami kitalálja, hogy milyen mértékegységekkel számoljuk a BMI-t(US vagy metric).
+ +29 + + + + + + +
	 * Attól függően, hogy mi a mértékegység, hívjuk meg a számolót.
+ +30 + + + + + + +
	 * @return a bmi értékével tér vissza a metódus
+ +31 + + + + + + +
	 * @throws Exception
+ +32 + + + + + + +
	 */
+ +33 + + + + + + +
	public double calculateBMI() throws Exception{ //végül kiszámoljuk a BMI-t
+ +34 + + +1 + + +1. calculateBMI : removed call to com/epam/bootcamp/bmi_calculator/App::ZeroChecker → SURVIVED
+ +
+
+
		ZeroChecker();
+ +35 + + + + + + +
		GuessTheUnits gtu = new GuessTheUnits(this.height, this.weight);
+ +36 + + +1 + + +1. calculateBMI : negated conditional → KILLED
+ +
+
+
		if(gtu.getUnitType().equals("US")){
+ +37 + + + + + + +
			UsBMI ubmi = new UsBMI();
+ +38 + + +1 + + +1. calculateBMI : removed call to com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI::setBMI → KILLED
+ +
+
+
			ubmi.setBMI(gtu.getWeight(), gtu.getHeight());
+ +39 + + + + + + +
			this.bmi = ubmi.getBMI();
+ +40 + + +1 + + +1. calculateBMI : negated conditional → KILLED
+ +
+
+
		}else if(gtu.getUnitType().equals("metric")){
+ +41 + + + + + + +
			MetricBMI mbmi = new MetricBMI();
+ +42 + + +1 + + +1. calculateBMI : removed call to com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI::setBMI → KILLED
+ +
+
+
			mbmi.setBMI(gtu.getWeight(), gtu.getHeight());
+ +43 + + + + + + +
			this.bmi = mbmi.getBMI();
+ +44 + + + + + + +
		}
+ +45 + + +1 + + +1. calculateBMI : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/App::calculateBMI → KILLED
+ +
+
+
		return this.bmi;
+ +46 + + + + + + +
	}
+ +47 + + + + + + +
	
+ +48 + + + + + + +
	/**
+ +49 + + + + + + +
	 * A bmi változó értékétől függően kapjuk meg az adott ember értékelését
+ +50 + + + + + + +
	 * @return Egy string, ami tartalmazza az értékelést
+ +51 + + + + + + +
	 */
+ +52 + + + + + + +
	public String bmiResult(){
+ +53 + + +2 + + +1. bmiResult : changed conditional boundary → SURVIVED
+ +2. bmiResult : negated conditional → KILLED
+ +
+
+
		if(this.bmi < 18.5){ // Sovány
+ +54 + + +1 + + +1. bmiResult : replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED
+ +
+
+
			return "Thinness";
+ +55 + + +4 + + +1. bmiResult : changed conditional boundary → SURVIVED
+ +2. bmiResult : changed conditional boundary → SURVIVED
+ +3. bmiResult : negated conditional → KILLED
+ +4. bmiResult : negated conditional → KILLED
+ +
+
+
		}else if(this.bmi >= 18.5 && this.bmi <= 24.9){ // Normál testalkatú
+ +56 + + +1 + + +1. bmiResult : replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED
+ +
+
+
			return "Normal";
+ +57 + + +4 + + +1. bmiResult : changed conditional boundary → SURVIVED
+ +2. bmiResult : changed conditional boundary → SURVIVED
+ +3. bmiResult : negated conditional → KILLED
+ +4. bmiResult : negated conditional → KILLED
+ +
+
+
		}else if(this.bmi > 24.9 && this.bmi <= 29.9){ // Túlsúlyos
+ +58 + + +1 + + +1. bmiResult : replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED
+ +
+
+
			return "Overweight";
+ +59 + + + + + + +
		}else{ // Erősen túlsúlyos
+ +60 + + +1 + + +1. bmiResult : replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED
+ +
+
+
			return "Heavily overweight";
+ +61 + + + + + + +
		}
+ +62 + + + + + + +
	}
+ +63 + + + + + + +
	
+ +64 + + + + + + +
	/**
+ +65 + + + + + + +
	 * Súly beállítása
+ +66 + + + + + + +
	 * @param weight a súly
+ +67 + + + + + + +
	 */
+ +68 + + + + + + +
	public void setWeight(double weight){
+ +69 + + + + + + +
		this.weight = weight;
+ +70 + + + + + + +
	}
+ +71 + + + + + + +
	
+ +72 + + + + + + +
	/**
+ +73 + + + + + + +
	 * Magasság beállítása
+ +74 + + + + + + +
	 * @param height a magasság
+ +75 + + + + + + +
	 */
+ +76 + + + + + + +
	public void setHeight(double height){
+ +77 + + + + + + +
		this.height = height;
+ +78 + + + + + + +
	}
+ +79 + + + + + + +
}

Mutations

17 + + + +

1.1
Location : ZeroChecker
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest11(com.epam.bootcamp.bmi_calculator.BMITest)
changed conditional boundary → KILLED

2.2
Location : ZeroChecker
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest11(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
20 + + + +

1.1
Location : ZeroChecker
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : ZeroChecker
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest4(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
34 + + + +

1.1
Location : calculateBMI
Killed by : none
removed call to com/epam/bootcamp/bmi_calculator/App::ZeroChecker → SURVIVED

+
36 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
38 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
removed call to com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI::setBMI → KILLED

+
40 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
42 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
removed call to com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI::setBMI → KILLED

+
45 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/App::calculateBMI → KILLED

+
53 + + + +

1.1
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
54 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest13(com.epam.bootcamp.bmi_calculator.BMITest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED

+
55 + + + +

1.1
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

3.3
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

4.4
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
56 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED

+
57 + + + +

1.1
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : bmiResult
Killed by : none
changed conditional boundary → SURVIVED

3.3
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest18(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

4.4
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest7(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
58 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest18(com.epam.bootcamp.bmi_calculator.BMITest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED

+
60 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest7(com.epam.bootcamp.bmi_calculator.BMITest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/App::bmiResult → KILLED

+
+ + +

Active mutators

+ + +

Tests examined

+ + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html b/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html new file mode 100644 index 0000000..eda347c --- /dev/null +++ b/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html @@ -0,0 +1,1900 @@ + + + + + + + + + +

GuessTheUnits.java

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +1 + + + + + + +
package com.epam.bootcamp.bmi_calculator;
+ +2 + + + + + + +
+ +3 + + + + + + +
public class GuessTheUnits{
+ +4 + + + + + + +
+ +5 + + + + + + +
	private double height;
+ +6 + + + + + + +
	private double weight;	
+ +7 + + + + + + +
	private String unitType;
+ +8 + + + + + + +
	
+ +9 + + + + + + +
	
+ +10 + + + + + + +
	/**
+ +11 + + + + + + +
	 * Váltószám konstansok
+ +12 + + + + + + +
	 */
+ +13 + + + + + + +
	private static final double ouncesToPounds = 0.0625;
+ +14 + + + + + + +
	private static final double centimeterToMeter = 100;
+ +15 + + + + + + +
	private static final double feetToInch = 12;
+ +16 + + + + + + +
	
+ +17 + + + + + + +
	public GuessTheUnits(double height, double weight) throws Exception{
+ +18 + + + + + + +
		this.height = height;
+ +19 + + + + + + +
		this.weight = weight;
+ +20 + + +1 + + +1. <init> : removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::guessUnit → KILLED
+ +
+
+
		guessUnit();
+ +21 + + + + + + +
	}
+ +22 + + + + + + +
	
+ +23 + + + + + + +
	/**
+ +24 + + + + + + +
	 * A mértékegység megállapító metódus.
+ +25 + + + + + + +
	 * Ha a magasság kisebb száznál, és azon belül 10 és 3 között van, akkor feetben kaptuk a magasságot.
+ +26 + + + + + + +
	 * Ha a magasság kisebb száznál, de nagyobb vagy egyenlő 10-el, akkor inchben.
+ +27 + + + + + + +
	 * Ha a magasság kisebb vagy egyenlő 3-al, akkor méterben.
+ +28 + + + + + + +
	 * Ha a magasság nagyobb száznál, akkor pedig centiméterben.
+ +29 + + + + + + +
	 * 
+ +30 + + + + + + +
	 * A magasság alapján meg tudjuk mondani, hogy milyen mértékegységben kaphattuk a súlyt.
+ +31 + + + + + + +
	 * Ha US mértékegységet használunk és a súly nagyobb mint ezer, akkor ounces-ban kaptuk meg a súlyt.
+ +32 + + + + + + +
	 * Ha metrikus mértékegységet használunk, és a súly nagyobb mint ezer, valószínűleg két különböző mértékegységben
+ +33 + + + + + + +
	 * kaptuk meg a magasságot és a súlyt, ezért hibát dob.
+ +34 + + + + + + +
	 * 
+ +35 + + + + + + +
	 * Ha feetben, centiméterben vagy ounces-ban kaptuk valamelyik értéket, a convertUnit metódussal át kell alakítanunk azt.
+ +36 + + + + + + +
	 * @throws Exception
+ +37 + + + + + + +
	 */
+ +38 + + + + + + +
	private void guessUnit() throws Exception{ // kitaláljuk a mértékegységet
+ +39 + + +2 + + +1. guessUnit : changed conditional boundary → KILLED
+ +2. guessUnit : negated conditional → KILLED
+ +
+
+
		if(this.height < 100){
+ +40 + + +4 + + +1. guessUnit : changed conditional boundary → SURVIVED
+ +2. guessUnit : changed conditional boundary → KILLED
+ +3. guessUnit : negated conditional → KILLED
+ +4. guessUnit : negated conditional → KILLED
+ +
+
+
			if(this.height < 10 && this.height > 3){ // feet
+ +41 + + +1 + + +1. guessUnit : removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED
+ +
+
+
				convertUnit("feet"); //átkonvertáljuk inch-re
+ +42 + + + + + + +
				this.unitType = "US";
+ +43 + + +2 + + +1. guessUnit : changed conditional boundary → SURVIVED
+ +2. guessUnit : negated conditional → KILLED
+ +
+
+
			}else if(this.height >= 10){ // inch
+ +44 + + + + + + +
				this.unitType = "US";
+ +45 + + + + + + +
			}else{ // meter
+ +46 + + + + + + +
				this.unitType = "metric";
+ +47 + + + + + + +
			}
+ +48 + + + + + + +
		}else{ // centimeter
+ +49 + + +1 + + +1. guessUnit : removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED
+ +
+
+
			convertUnit("centimeter"); //átkonvertáljuk méterre
+ +50 + + + + + + +
			this.unitType = "metric";
+ +51 + + + + + + +
		}
+ +52 + + + + + + +
		
+ +53 + + +1 + + +1. guessUnit : negated conditional → KILLED
+ +
+
+
		if(this.unitType.equals("US")){ // ounces
+ +54 + + +2 + + +1. guessUnit : changed conditional boundary → SURVIVED
+ +2. guessUnit : negated conditional → KILLED
+ +
+
+
			if(this.weight > 1000){
+ +55 + + +1 + + +1. guessUnit : removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED
+ +
+
+
				convertUnit("ounces"); //átkonvertáljuk fontra
+ +56 + + + + + + +
			}
+ +57 + + + + + + +
		}else{
+ +58 + + +2 + + +1. guessUnit : changed conditional boundary → KILLED
+ +2. guessUnit : negated conditional → KILLED
+ +
+
+
			if(this.weight > 1000){
+ +59 + + + + + + +
				throw new Exception("Height and weight is in different metric.");
+ +60 + + + + + + +
			}
+ +61 + + + + + + +
		}
+ +62 + + + + + + +
	}
+ +63 + + + + + + +
	
+ +64 + + + + + + +
	
+ +65 + + + + + + +
	/**
+ +66 + + + + + + +
	 * Átváltja a mértékegységeket egységesre.
+ +67 + + + + + + +
	 * @param unit
+ +68 + + + + + + +
	 */
+ +69 + + + + + + +
	private void convertUnit(String unit){
+ +70 + + +1 + + +1. convertUnit : negated conditional → KILLED
+ +
+
+
		if(unit.equals("ounces")){
+ +71 + + +1 + + +1. convertUnit : Replaced double multiplication with division → KILLED
+ +
+
+
			this.weight = this.weight * ouncesToPounds;
+ +72 + + + + + + +
		}
+ +73 + + +1 + + +1. convertUnit : negated conditional → KILLED
+ +
+
+
		if(unit.equals("feet")){
+ +74 + + +1 + + +1. convertUnit : Replaced double multiplication with division → KILLED
+ +
+
+
			this.height = this.height * feetToInch;
+ +75 + + + + + + +
		}
+ +76 + + +1 + + +1. convertUnit : negated conditional → KILLED
+ +
+
+
		if(unit.equals("centimeter")){
+ +77 + + +1 + + +1. convertUnit : Replaced double division with multiplication → KILLED
+ +
+
+
			this.height = this.height / centimeterToMeter;
+ +78 + + + + + + +
		}
+ +79 + + + + + + +
	}
+ +80 + + + + + + +
	
+ +81 + + + + + + +
	/**
+ +82 + + + + + + +
	 * Súly getter
+ +83 + + + + + + +
	 * @return a súly
+ +84 + + + + + + +
	 */
+ +85 + + + + + + +
	public double getWeight(){
+ +86 + + +1 + + +1. getWeight : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getWeight → KILLED
+ +
+
+
		return this.weight;
+ +87 + + + + + + +
	}
+ +88 + + + + + + +
	
+ +89 + + + + + + +
	/**
+ +90 + + + + + + +
	 * Magasság getter
+ +91 + + + + + + +
	 * @return magasság
+ +92 + + + + + + +
	 */
+ +93 + + + + + + +
	public double getHeight(){
+ +94 + + +1 + + +1. getHeight : replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getHeight → KILLED
+ +
+
+
		return this.height;
+ +95 + + + + + + +
	}
+ +96 + + + + + + +
	
+ +97 + + + + + + +
	/**
+ +98 + + + + + + +
	 * A mértékegység típusa getter
+ +99 + + + + + + +
	 * @return mértékegység típusa
+ +100 + + + + + + +
	 */
+ +101 + + + + + + +
	public String getUnitType(){
+ +102 + + +1 + + +1. getUnitType : replaced return value with "" for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getUnitType → KILLED
+ +
+
+
		return this.unitType;
+ +103 + + + + + + +
	}
+ +104 + + + + + + +
}

Mutations

20 + + + +

1.1
Location : <init>
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest1(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::guessUnit → KILLED

+
39 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest5(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
changed conditional boundary → KILLED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest5(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
40 + + + +

1.1
Location : guessUnit
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest8(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
changed conditional boundary → KILLED

3.3
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest3(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

4.4
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest1(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
41 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED

+
43 + + + +

1.1
Location : guessUnit
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest1(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
49 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED

+
53 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest10(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
54 + + + +

1.1
Location : guessUnit
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest3(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
55 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest3(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
removed call to com/epam/bootcamp/bmi_calculator/GuessTheUnits::convertUnit → KILLED

+
58 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest7(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
changed conditional boundary → KILLED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest1(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
70 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest10(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
negated conditional → KILLED

+
71 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest3(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
Replaced double multiplication with division → KILLED

+
73 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
74 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

+
76 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
77 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest5(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double division with multiplication → KILLED

+
86 + + + +

1.1
Location : getWeight
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest3(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getWeight → KILLED

+
94 + + + +

1.1
Location : getHeight
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest12(com.epam.bootcamp.bmi_calculator.BMITest)
replaced double return with 0.0d for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getHeight → KILLED

+
102 + + + +

1.1
Location : getUnitType
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest1(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
replaced return value with "" for com/epam/bootcamp/bmi_calculator/GuessTheUnits::getUnitType → KILLED

+
+ + +

Active mutators

+ + +

Tests examined

+ + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator/index.html b/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator/index.html new file mode 100644 index 0000000..012cf10 --- /dev/null +++ b/testy uzupełnione/raport/com.epam.bootcamp.bmi_calculator/index.html @@ -0,0 +1,69 @@ + + + + + + + + +

Pit Test Coverage Report

+

Package Summary

+

com.epam.bootcamp.bmi_calculator

+ + + + + + + + + + + + + + + + + +
Number of ClassesLine CoverageMutation CoverageTest Strength
2100%
58/58
80%
40/50
80%
40/50
+ + +

Breakdown by Class

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameLine CoverageMutation CoverageTest Strength
App.java
100%
28/28
71%
17/24
71%
17/24
GuessTheUnits.java
100%
30/30
88%
23/26
88%
23/26
+
+ + + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy uzupełnione/raport/index.html b/testy uzupełnione/raport/index.html new file mode 100644 index 0000000..feef1be --- /dev/null +++ b/testy uzupełnione/raport/index.html @@ -0,0 +1,72 @@ + + + + + + + + +

Pit Test Coverage Report

+ +

Project Summary

+ + + + + + + + + + + + + + + + + +
Number of ClassesLine CoverageMutation CoverageTest Strength
4100%
66/66
82%
47/57
82%
47/57
+ + +

Breakdown by Package

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameNumber of ClassesLine CoverageMutation CoverageTest Strength
com.epam.bootcamp.bmi_calculator2
100%
58/58
80%
40/50
80%
40/50
com.epam.bootcamp.bmi_calculator.interfacesImplements2
100%
8/8
100%
7/7
100%
7/7
+
+ + + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/testy uzupełnione/raport/style.css b/testy uzupełnione/raport/style.css new file mode 100644 index 0000000..303bfba --- /dev/null +++ b/testy uzupełnione/raport/style.css @@ -0,0 +1,563 @@ +html, body, div, span, p, blockquote, pre { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +body{ + line-height: 1; + color: black; + background: white; + margin-left: 20px; +} + +.src { + border: 1px solid #dddddd; + padding-top: 10px; + padding-right: 5px; + padding-left: 5px; + font-family: Consolas, Courier, monospace; +} + +.covered, .COVERED { + background-color: #ddffdd; +} + +.uncovered, .UNCOVERED { + background-color: #ffdddd; +} + +.killed, .KILLED { + background-color: #aaffaa; +} + +.survived, .SURVIVED { + background-color: #ffaaaa; +} + +.uncertain, .UNCERTAIN { + background-color: #dde7ef; +} + +.run_error, .RUN_ERROR { + background-color: #dde7ef; +} + +.na { + background-color: #eeeeee; +} + +.timed_out, .TIMED_OUT { + background-color: #dde7ef; +} + +.non_viable, .NON_VIABLE { + background-color: #aaffaa; +} + +.memory_error, .MEMORY_ERROR { + background-color: #dde7ef; +} + +.not_started, .NO_STARTED { + background-color: #dde7ef; color : red +} + +.no_coverage, .NO_COVERAGE { + background-color: #ffaaaa; +} + +.tests { + width: 50%; + float: left; +} + +.mutees { + float: right; + width: 50%; +} + +.unit { + padding-top: 20px; + clear: both; +} + +.coverage_bar { + display: inline-block; + height: 1.1em; + width: 130px; + background: #FAA; + margin: 0 5px; + vertical-align: middle; + border: 1px solid #AAA; + position: relative; +} + +.coverage_complete { + display: inline-block; + height: 100%; + background: #DFD; + float: left; +} + +.coverage_legend { + position: absolute; + height: 100%; + width: 100%; + left: 0; + top: 0; + text-align: center; +} + +.line, .mut { + vertical-align: middle; +} + +.coverage_percentage { + display: inline-block; + width: 3em; + text-align: right; +} + +.pop { + outline:none; +} + +.pop strong { + line-height: 30px; +} + +.pop { + text-decoration: none; +} + +.pop span { + z-index: 10; + display: none; + padding: 14px 20px; + margin-top: -30px; + margin-left: 28px; + width: 800px; + line-height: 16px; + word-wrap: break-word; + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -moz-box-shadow: 5px 5px 8px #CCC; + -webkit-box-shadow: 5px 5px 8px #CCC; + box-shadow: 5px 5px 8px #CCC; +} + +.pop:hover span { + display: inline; + position: absolute; + color: #111; + border: 1px solid #DCA; + background: #fffAF0; +} + +.width-1 { + width: 1%; +} + +.width-2 { + width: 2%; +} + +.width-3 { + width: 3%; +} + +.width-4 { + width: 4%; +} + +.width-5 { + width: 5%; +} + +.width-6 { + width: 6%; +} + +.width-7 { + width: 7%; +} + +.width-8 { + width: 8%; +} + +.width-9 { + width: 9%; +} + +.width-10 { + width: 10%; +} + +.width-11 { + width: 11%; +} + +.width-12 { + width: 12%; +} + +.width-13 { + width: 13%; +} + +.width-14 { + width: 14%; +} + +.width-15 { + width: 15%; +} + +.width-16 { + width: 16%; +} + +.width-17 { + width: 17%; +} + +.width-18 { + width: 18%; +} + +.width-19 { + width: 19%; +} + +.width-20 { + width: 20%; +} + +.width-21 { + width: 21%; +} + +.width-22 { + width: 22%; +} + +.width-23 { + width: 23%; +} + +.width-24 { + width: 24%; +} + +.width-25 { + width: 25%; +} + +.width-26 { + width: 26%; +} + +.width-27 { + width: 27%; +} + +.width-28 { + width: 28%; +} + +.width-29 { + width: 29%; +} + +.width-30 { + width: 30%; +} + +.width-31 { + width: 31%; +} + +.width-32 { + width: 32%; +} + +.width-33 { + width: 33%; +} + +.width-34 { + width: 34%; +} + +.width-35 { + width: 35%; +} + +.width-36 { + width: 36%; +} + +.width-37 { + width: 37%; +} + +.width-38 { + width: 38%; +} + +.width-39 { + width: 39%; +} + +.width-40 { + width: 40%; +} + +.width-41 { + width: 41%; +} + +.width-42 { + width: 42%; +} + +.width-43 { + width: 43%; +} + +.width-44 { + width: 44%; +} + +.width-45 { + width: 45%; +} + +.width-46 { + width: 46%; +} + +.width-47 { + width: 47%; +} + +.width-48 { + width: 48%; +} + +.width-49 { + width: 49%; +} + +.width-50 { + width: 50%; +} + +.width-51 { + width: 51%; +} + +.width-52 { + width: 52%; +} + +.width-53 { + width: 53%; +} + +.width-54 { + width: 54%; +} + +.width-55 { + width: 55%; +} + +.width-56 { + width: 56%; +} + +.width-57 { + width: 57%; +} + +.width-58 { + width: 58%; +} + +.width-59 { + width: 59%; +} + +.width-60 { + width: 60%; +} + +.width-61 { + width: 61%; +} + +.width-62 { + width: 62%; +} + +.width-63 { + width: 63%; +} + +.width-64 { + width: 64%; +} + +.width-65 { + width: 65%; +} + +.width-66 { + width: 66%; +} + +.width-67 { + width: 67%; +} + +.width-68 { + width: 68%; +} + +.width-69 { + width: 69%; +} + +.width-70 { + width: 70%; +} + +.width-71 { + width: 71%; +} + +.width-72 { + width: 72%; +} + +.width-73 { + width: 73%; +} + +.width-74 { + width: 74%; +} + +.width-75 { + width: 75%; +} + +.width-76 { + width: 76%; +} + +.width-77 { + width: 77%; +} + +.width-78 { + width: 78%; +} + +.width-79 { + width: 79%; +} + +.width-80 { + width: 80%; +} + +.width-81 { + width: 81%; +} + +.width-82 { + width: 82%; +} + +.width-83 { + width: 83%; +} + +.width-84 { + width: 84%; +} + +.width-85 { + width: 85%; +} + +.width-86 { + width: 86%; +} + +.width-87 { + width: 87%; +} + +.width-88 { + width: 88%; +} + +.width-89 { + width: 89%; +} + +.width-90 { + width: 90%; +} + +.width-91 { + width: 91%; +} + +.width-92 { + width: 92%; +} + +.width-93 { + width: 93%; +} + +.width-94 { + width: 94%; +} + +.width-95 { + width: 95%; +} + +.width-96 { + width: 96%; +} + +.width-97 { + width: 97%; +} + +.width-98 { + width: 98%; +} + +.width-99 { + width: 99%; +} + +.width-100 { + width: 100%; +} \ No newline at end of file