commit a2dd563c863566c3144a54e5564473e6844de748 Author: s464840 Date: Mon Jun 20 14:04:23 2022 +0200 projekt diff --git a/Aplikacja początkowa/.idea/.gitignore b/Aplikacja początkowa/.idea/.gitignore new file mode 100644 index 0000000..eaf91e2 --- /dev/null +++ b/Aplikacja początkowa/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/Aplikacja początkowa/.idea/inspectionProfiles/profiles_settings.xml b/Aplikacja początkowa/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/Aplikacja początkowa/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/Aplikacja początkowa/.idea/misc.xml b/Aplikacja początkowa/.idea/misc.xml new file mode 100644 index 0000000..8d93904 --- /dev/null +++ b/Aplikacja początkowa/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Aplikacja początkowa/.idea/modules.xml b/Aplikacja początkowa/.idea/modules.xml new file mode 100644 index 0000000..21c68dc --- /dev/null +++ b/Aplikacja początkowa/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Aplikacja początkowa/.idea/wprowadzenie do testowania projekt.iml b/Aplikacja początkowa/.idea/wprowadzenie do testowania projekt.iml new file mode 100644 index 0000000..d9e6024 --- /dev/null +++ b/Aplikacja początkowa/.idea/wprowadzenie do testowania projekt.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Aplikacja początkowa/bmi-calculator-master/.gitattributes b/Aplikacja początkowa/bmi-calculator-master/.gitattributes new file mode 100644 index 0000000..bdb0cab --- /dev/null +++ b/Aplikacja początkowa/bmi-calculator-master/.gitattributes @@ -0,0 +1,17 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/Aplikacja początkowa/bmi-calculator-master/.gitignore b/Aplikacja początkowa/bmi-calculator-master/.gitignore new file mode 100644 index 0000000..1389484 --- /dev/null +++ b/Aplikacja początkowa/bmi-calculator-master/.gitignore @@ -0,0 +1,3 @@ +.classpath +.project +target/ \ No newline at end of file diff --git a/Aplikacja początkowa/bmi-calculator-master/.settings/org.eclipse.core.resources.prefs b/Aplikacja początkowa/bmi-calculator-master/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..f9fe345 --- /dev/null +++ b/Aplikacja początkowa/bmi-calculator-master/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/Aplikacja początkowa/bmi-calculator-master/.settings/org.eclipse.jdt.core.prefs b/Aplikacja początkowa/bmi-calculator-master/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..512e22a --- /dev/null +++ b/Aplikacja początkowa/bmi-calculator-master/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,16 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.processAnnotations=disabled +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/Aplikacja początkowa/bmi-calculator-master/.settings/org.eclipse.m2e.core.prefs b/Aplikacja początkowa/bmi-calculator-master/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/Aplikacja początkowa/bmi-calculator-master/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/Aplikacja początkowa/bmi-calculator-master/pom.xml b/Aplikacja początkowa/bmi-calculator-master/pom.xml new file mode 100644 index 0000000..0f20d0f --- /dev/null +++ b/Aplikacja początkowa/bmi-calculator-master/pom.xml @@ -0,0 +1,29 @@ + + 4.0.0 + + com.epam.bootcamp + bmi-calculator + 1.0 + jar + + bmi-calculator + + + UTF-8 + + + + + junit + junit + 4.11 + test + + + net.revelc.code.formatter + formatter-maven-plugin + 2.0.1 + + + diff --git a/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/App.java b/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/App.java new file mode 100644 index 0000000..4ea55d1 --- /dev/null +++ b/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/App.java @@ -0,0 +1,79 @@ +package com.epam.bootcamp.bmi_calculator; + +import com.epam.bootcamp.bmi_calculator.interfacesImplements.*; + +public class App extends Exception +{ + + private double weight; + private double height; + private double bmi; + + /** + * A ZeroChecker megnézi, hogy nulla vagy kevesebb-e a súly vagy a magasság. + * Ha valamelyik nulla vagy kevesebb, akkor hibát dob. + */ + private void ZeroChecker() throws Exception{ + if(this.weight <= 0){ + throw new Exception("Weight is equals or less than zero."); + } + if(this.height <= 0){ + throw new Exception("Height is equals or less than zero."); + } + } + + /** + * Ez adja értéknek a BMI-t a bmi változónak. + * Először megnézi a ZeroCheckerrel a kapott értékeket. + * Meghívja a GuessTheUnits osztályt, ami kitalálja, hogy milyen mértékegységekkel számoljuk a BMI-t(US vagy metric). + * Attól függően, hogy mi a mértékegység, hívjuk meg a számolót. + * @return a bmi értékével tér vissza a metódus + * @throws Exception + */ + public double calculateBMI() throws Exception{ //végül kiszámoljuk a BMI-t + ZeroChecker(); + GuessTheUnits gtu = new GuessTheUnits(this.height, this.weight); + if(gtu.getUnitType().equals("US")){ + UsBMI ubmi = new UsBMI(); + ubmi.setBMI(gtu.getWeight(), gtu.getHeight()); + this.bmi = ubmi.getBMI(); + }else if(gtu.getUnitType().equals("metric")){ + MetricBMI mbmi = new MetricBMI(); + mbmi.setBMI(gtu.getWeight(), gtu.getHeight()); + this.bmi = mbmi.getBMI(); + } + return this.bmi; + } + + /** + * A bmi változó értékétől függően kapjuk meg az adott ember értékelését + * @return Egy string, ami tartalmazza az értékelést + */ + public String bmiResult(){ + if(this.bmi < 18.5){ // Sovány + return "Thinness"; + }else if(this.bmi >= 18.5 && this.bmi <= 24.9){ // Normál testalkatú + return "Normal"; + }else if(this.bmi > 24.9 && this.bmi <= 29.9){ // Túlsúlyos + return "Overweight"; + }else{ // Erősen túlsúlyos + return "Heavily overweight"; + } + } + + /** + * Súly beállítása + * @param weight a súly + */ + public void setWeight(double weight){ + this.weight = weight; + } + + /** + * Magasság beállítása + * @param height a magasság + */ + public void setHeight(double height){ + this.height = height; + } +} diff --git a/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/GuessTheUnits.java b/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/GuessTheUnits.java new file mode 100644 index 0000000..1f8f2e4 --- /dev/null +++ b/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/GuessTheUnits.java @@ -0,0 +1,104 @@ +package com.epam.bootcamp.bmi_calculator; + +public class GuessTheUnits{ + + private double height; + private double weight; + private String unitType; + + + /** + * Váltószám konstansok + */ + private static final double ouncesToPounds = 0.0625; + private static final double centimeterToMeter = 100; + private static final double feetToInch = 12; + + public GuessTheUnits(double height, double weight) throws Exception{ + this.height = height; + this.weight = weight; + guessUnit(); + } + + /** + * A mértékegység megállapító metódus. + * 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. + * Ha a magasság kisebb száznál, de nagyobb vagy egyenlő 10-el, akkor inchben. + * Ha a magasság kisebb vagy egyenlő 3-al, akkor méterben. + * Ha a magasság nagyobb száznál, akkor pedig centiméterben. + * + * A magasság alapján meg tudjuk mondani, hogy milyen mértékegységben kaphattuk a súlyt. + * Ha US mértékegységet használunk és a súly nagyobb mint ezer, akkor ounces-ban kaptuk meg a súlyt. + * 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 + * kaptuk meg a magasságot és a súlyt, ezért hibát dob. + * + * Ha feetben, centiméterben vagy ounces-ban kaptuk valamelyik értéket, a convertUnit metódussal át kell alakítanunk azt. + * @throws Exception + */ + private void guessUnit() throws Exception{ // kitaláljuk a mértékegységet + if(this.height < 100){ + if(this.height < 10 && this.height > 3){ // feet + convertUnit("feet"); //átkonvertáljuk inch-re + this.unitType = "US"; + }else if(this.height >= 10){ // inch + this.unitType = "US"; + }else{ // meter + this.unitType = "metric"; + } + }else{ // centimeter + convertUnit("centimeter"); //átkonvertáljuk méterre + this.unitType = "metric"; + } + + if(this.unitType.equals("US")){ // ounces + if(this.weight > 1000){ + convertUnit("ounces"); //átkonvertáljuk fontra + } + }else{ + if(this.weight > 1000){ + throw new Exception("Height and weight is in different metric."); + } + } + } + + + /** + * Átváltja a mértékegységeket egységesre. + * @param unit + */ + private void convertUnit(String unit){ + if(unit.equals("ounces")){ + this.weight = this.weight * ouncesToPounds; + } + if(unit.equals("feet")){ + this.height = this.height * feetToInch; + } + if(unit.equals("centimeter")){ + this.height = this.height / centimeterToMeter; + } + } + + /** + * Súly getter + * @return a súly + */ + public double getWeight(){ + return this.weight; + } + + /** + * Magasság getter + * @return magasság + */ + public double getHeight(){ + return this.height; + } + + /** + * A mértékegység típusa getter + * @return mértékegység típusa + */ + public String getUnitType(){ + return this.unitType; + } +} diff --git a/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/interfaces/UnitsInterface.java b/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/interfaces/UnitsInterface.java new file mode 100644 index 0000000..4b71c28 --- /dev/null +++ b/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/interfaces/UnitsInterface.java @@ -0,0 +1,17 @@ +package com.epam.bootcamp.bmi_calculator.interfaces; + +/** + * Metrikus vagy US mértékegység interface + * @author bencekiraly + * + */ +public interface UnitsInterface{ + + double getBMI(); + + /** + * Itt számoljuk ki a testtömegindexet. + */ + void setBMI(double weight, double height); + +} diff --git a/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI.java b/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI.java new file mode 100644 index 0000000..5e13954 --- /dev/null +++ b/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/interfacesImplements/MetricBMI.java @@ -0,0 +1,17 @@ +package com.epam.bootcamp.bmi_calculator.interfacesImplements; + +import com.epam.bootcamp.bmi_calculator.interfaces.UnitsInterface; + +public class MetricBMI implements UnitsInterface{ + + private double bmi; + + public double getBMI(){ + return this.bmi; + } + + public void setBMI(double weight, double height){ + this.bmi = weight/(height*height); //számolja a metrikus BMI-t + } + +} diff --git a/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI.java b/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI.java new file mode 100644 index 0000000..baad2f7 --- /dev/null +++ b/Aplikacja początkowa/bmi-calculator-master/src/main/java/com/epam/bootcamp/bmi_calculator/interfacesImplements/UsBMI.java @@ -0,0 +1,22 @@ +package com.epam.bootcamp.bmi_calculator.interfacesImplements; + +import com.epam.bootcamp.bmi_calculator.interfaces.UnitsInterface; + +public class UsBMI implements UnitsInterface{ + + private static final int usMultiplier = 703; + + private double bmi; + + public double getBMI(){ + return this.bmi; + } + + /** + * A US mértékegységnél kell konstans, amilve meg kell szorozni a súlyt. Ezt a szorzót a usMultiplier konstans tartalmazza + */ + public void setBMI(double weight, double height){ + this.bmi = usMultiplier*weight/(height*height); // számolja a US bmi-t + } + +} diff --git a/Aplikacja początkowa/bmi-calculator-master/src/test/java/com/epam/bootcamp/bmi_calculator/BMITest.java b/Aplikacja początkowa/bmi-calculator-master/src/test/java/com/epam/bootcamp/bmi_calculator/BMITest.java new file mode 100644 index 0000000..bd4b991 --- /dev/null +++ b/Aplikacja początkowa/bmi-calculator-master/src/test/java/com/epam/bootcamp/bmi_calculator/BMITest.java @@ -0,0 +1,372 @@ +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 BMITest39() throws Exception{ + try{ + app.setHeight(0.001); + app.setWeight(150.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest40() throws Exception{ + try{ + app.setHeight(0.00); + app.setWeight(150.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest12() throws Exception{ + try{ + app.setHeight(-0.01); + app.setWeight(50.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest13() throws Exception{ + try{ + app.setHeight(-1); + app.setWeight(50.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest14() throws Exception{ + try{ + app.setHeight(-11); + 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 BMITest37() 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 BMITest38() throws Exception{ + try{ + app.setHeight(0); + app.setWeight(10); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest10() throws Exception{ + try{ + app.setHeight(1); + app.setWeight(-1); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + @Test + public void BMITest31() throws Exception{ + try{ + app.setHeight(0); + app.setWeight(1); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest32() 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 BMITest33() throws Exception{ + try{ + app.setHeight(188); + app.setWeight(0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + @Test + public void BMITest34() throws Exception{ + try{ + app.setHeight(188); + app.setWeight(0.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + @Test + public void BMITest35() throws Exception{ + try{ + app.setHeight(0); + app.setWeight(123); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest36() throws Exception{ + try{ + app.setHeight(0.0); + app.setWeight(76); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest11() throws Exception{ + try{ + app.setHeight(1); + app.setWeight(-300000); + 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 BMITest18() throws Exception{ + try{ + app.setHeight(5.9); + app.setWeight(60); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height and weight is in different metric."); + } + } + @Test + public void BMITest19() throws Exception{ + try{ + app.setHeight(5.1); + app.setWeight(-60); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + + @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 BMITest15() throws Exception{ + app.setHeight(6.56); + app.setWeight(2220.47); + assertEquals(app.calculateBMI(),15.743818755222017,0.5); + assertEquals(app.bmiResult(),"Thinness"); + } + @Test + public void BMITest16() throws Exception{ + app.setHeight(1.56); + app.setWeight(220.47); + assertEquals(app.calculateBMI(),90.59418145956607,0.5); + assertEquals(app.bmiResult(),"Heavily 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 BMITest17() throws Exception{ + app.setHeight(210); + app.setWeight(83); + assertEquals(app.calculateBMI(),18.820861678004533,0.0); + assertEquals(app.bmiResult(),"Normal"); + } + @Test + public void BMITest20() throws Exception{ + app.setHeight(5.58); + app.setWeight(1788); + assertEquals(app.calculateBMI(),18.4,1); + assertEquals(app.bmiResult(),"Thinness"); + } + @Test + public void BMITest28() throws Exception{ + app.setHeight(180); + app.setWeight(59.98); + assertEquals(app.calculateBMI(),18.5,1); + assertEquals(app.bmiResult(),"Normal"); + } + @Test + public void BMITest21() throws Exception{ + app.setHeight(180); + app.setWeight(59.5); + assertEquals(app.calculateBMI(),18.3,1); + assertEquals(app.bmiResult(),"Thinness"); + } + @Test + public void BMITest27() throws Exception{ + app.setHeight(180); + app.setWeight(60.5); + assertEquals(app.calculateBMI(),18.3,1); + assertEquals(app.bmiResult(),"Normal"); + } + @Test + public void BMITest22() throws Exception{ + app.setHeight(180); + app.setWeight(80.3); + assertEquals(app.calculateBMI(),24.78,1); + assertEquals(app.bmiResult(),"Normal"); + } + @Test + public void BMITest29() throws Exception{ + app.setHeight(180); + app.setWeight(80.6); + assertEquals(app.calculateBMI(),24.9,1); + assertEquals(app.bmiResult(),"Normal"); + } + @Test + public void BMITest25() throws Exception{ + app.setHeight(180); + app.setWeight(81); + assertEquals(app.calculateBMI(),25,1); + assertEquals(app.bmiResult(),"Overweight"); + } + @Test + public void BMITest23() throws Exception{ + app.setHeight(180); + app.setWeight(96); + assertEquals(app.calculateBMI(),29.6,1); + assertEquals(app.bmiResult(),"Overweight"); + } + @Test + public void BMITest30() throws Exception{ + app.setHeight(180); + app.setWeight(96.8); + assertEquals(app.calculateBMI(),29.9,1); + assertEquals(app.bmiResult(),"Overweight"); + } + @Test + public void BMITest24() throws Exception{ + app.setHeight(180); + app.setWeight(99); + assertEquals(app.calculateBMI(),30.6,1); + assertEquals(app.bmiResult(),"Heavily overweight"); + } + +} \ No newline at end of file diff --git a/Aplikacja początkowa/bmi-calculator-master/src/test/java/com/epam/bootcamp/bmi_calculator/GuessTheUnitsTest.java b/Aplikacja początkowa/bmi-calculator-master/src/test/java/com/epam/bootcamp/bmi_calculator/GuessTheUnitsTest.java new file mode 100644 index 0000000..33cfabb --- /dev/null +++ b/Aplikacja początkowa/bmi-calculator-master/src/test/java/com/epam/bootcamp/bmi_calculator/GuessTheUnitsTest.java @@ -0,0 +1,127 @@ +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."); + } + } + @Test + public void GuessTheUnitsTest5() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9.99,3.01); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),3.01,1); + } + @Test + public void GuessTheUnitsTest13() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(10,3.01); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),3.01,1); + } + @Test + public void GuessTheUnitsTest14() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(10.01,3.01); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),3.01,1); + } + @Test + public void GuessTheUnitsTest6() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9.99,2.99); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),3.01,1); + } + @Test + public void GuessTheUnitsTest7() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(99,999); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),999.0,1); + } + @Test + public void GuessTheUnitsTest8() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(101,20.0); + assertEquals(gtu.getUnitType(),"metric"); + } + @Test + public void GuessTheUnitsTest9() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(100,1000); + assertEquals(gtu.getUnitType(),"metric"); + } + @Test + public void GuessTheUnitsTest10() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(99,999); + assertEquals(gtu.getUnitType(),"US"); + } + @Test + public void GuessTheUnitsTest11() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(100,999); + assertEquals(gtu.getUnitType(),"metric"); + } + @Test + public void GuessTheUnitsTest12() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(99,1000); + assertEquals(gtu.getUnitType(),"US"); + } + @Test + public void GuessTheUnitsTest15() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(10,1000); + assertEquals(gtu.getUnitType(),"US"); + } + @Test + public void GuessTheUnitsTest16() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9,1000); + assertEquals(gtu.getUnitType(),"US"); + } + @Test + public void GuessTheUnitsTest17() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9,1001); + assertEquals(gtu.getUnitType(),"US"); + } + @Test + public void GuessTheUnitsTest18() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9,999); + assertEquals(gtu.getUnitType(),"US"); + } + @Test + public void GuessTheUnitsTest19() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(3,1000); + assertEquals(gtu.getUnitType(),"metric"); + } + @Test + public void GuessTheUnitsTest20() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(3.,600); + assertEquals(gtu.getUnitType(),"metric"); + } + @Test + public void GuessTheUnitsTest21() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(3,1000); + assertEquals(gtu.getUnitType(),"metric"); + } +} diff --git a/Pit raport bez żadnych dodanych testów/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html b/Pit raport bez żadnych dodanych testów/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html new file mode 100644 index 0000000..1ba88f7 --- /dev/null +++ b/Pit raport bez żadnych dodanych testów/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/Pit raport bez żadnych dodanych testów/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html b/Pit raport bez żadnych dodanych testów/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html new file mode 100644 index 0000000..90fe274 --- /dev/null +++ b/Pit raport bez żadnych dodanych testów/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.BMITest8(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.BMITest8(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

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

3.3
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest8(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/Pit raport bez żadnych dodanych testów/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html b/Pit raport bez żadnych dodanych testów/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html new file mode 100644 index 0000000..2afae5e --- /dev/null +++ b/Pit raport bez żadnych dodanych testów/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/Pit raport bez żadnych dodanych testów/com.epam.bootcamp.bmi_calculator/App.java.html b/Pit raport bez żadnych dodanych testów/com.epam.bootcamp.bmi_calculator/App.java.html new file mode 100644 index 0000000..d001b8c --- /dev/null +++ b/Pit raport bez żadnych dodanych testów/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.BMITest8(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.BMITest8(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.BMITest8(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/Pit raport bez żadnych dodanych testów/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html b/Pit raport bez żadnych dodanych testów/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html new file mode 100644 index 0000000..1f1eba7 --- /dev/null +++ b/Pit raport bez żadnych dodanych testów/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.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 : 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.BMITest8(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.GuessTheUnitsTest1(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.BMITest8(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.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/Pit raport bez żadnych dodanych testów/com.epam.bootcamp.bmi_calculator/index.html b/Pit raport bez żadnych dodanych testów/com.epam.bootcamp.bmi_calculator/index.html new file mode 100644 index 0000000..587b2d4 --- /dev/null +++ b/Pit raport bez żadnych dodanych testów/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%
61/61
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%
33/33
77%
20/26
77%
20/26
+
+ + + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/Pit raport bez żadnych dodanych testów/index.html b/Pit raport bez żadnych dodanych testów/index.html new file mode 100644 index 0000000..ad4ba3d --- /dev/null +++ b/Pit raport bez żadnych dodanych testów/index.html @@ -0,0 +1,72 @@ + + + + + + + + +

Pit Test Coverage Report

+ +

Project Summary

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

Breakdown by Package

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameNumber of ClassesLine CoverageMutation CoverageTest Strength
com.epam.bootcamp.bmi_calculator2
100%
61/61
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/Pit raport bez żadnych dodanych testów/style.css b/Pit raport bez żadnych dodanych testów/style.css new file mode 100644 index 0000000..303bfba --- /dev/null +++ b/Pit raport bez żadnych dodanych testów/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/Pit raport po dodaniu testów/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html b/Pit raport po dodaniu testów/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html new file mode 100644 index 0000000..9836186 --- /dev/null +++ b/Pit raport po dodaniu testów/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.BMITest16(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.BMITest16(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

2.2
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest16(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/Pit raport po dodaniu testów/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html b/Pit raport po dodaniu testów/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html new file mode 100644 index 0000000..30737fd --- /dev/null +++ b/Pit raport po dodaniu testów/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/Pit raport po dodaniu testów/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html b/Pit raport po dodaniu testów/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html new file mode 100644 index 0000000..2afae5e --- /dev/null +++ b/Pit raport po dodaniu testów/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/Pit raport po dodaniu testów/com.epam.bootcamp.bmi_calculator/App.java.html b/Pit raport po dodaniu testów/com.epam.bootcamp.bmi_calculator/App.java.html new file mode 100644 index 0000000..4083fe9 --- /dev/null +++ b/Pit raport po dodaniu testów/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.BMITest13(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.BMITest16(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.BMITest16(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
42 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest16(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.BMITest16(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.BMITest16(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.BMITest17(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

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

+
56 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest17(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.BMITest16(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.BMITest16(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/Pit raport po dodaniu testów/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html b/Pit raport po dodaniu testów/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html new file mode 100644 index 0000000..2b0e0d7 --- /dev/null +++ b/Pit raport po dodaniu testów/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 → 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 → 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.GuessTheUnitsTest11(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
changed conditional boundary → KILLED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest10(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.BMITest8(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.GuessTheUnitsTest3(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.GuessTheUnitsTest7(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.GuessTheUnitsTest9(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.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.BMITest8(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.GuessTheUnitsTest7(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.BMITest16(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/Pit raport po dodaniu testów/com.epam.bootcamp.bmi_calculator/index.html b/Pit raport po dodaniu testów/com.epam.bootcamp.bmi_calculator/index.html new file mode 100644 index 0000000..046b561 --- /dev/null +++ b/Pit raport po dodaniu testów/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%
61/61
76%
38/50
76%
38/50
+ + +

Breakdown by Class

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameLine CoverageMutation CoverageTest Strength
App.java
100%
28/28
67%
16/24
67%
16/24
GuessTheUnits.java
100%
33/33
85%
22/26
85%
22/26
+
+ + + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/Pit raport po dodaniu testów/index.html b/Pit raport po dodaniu testów/index.html new file mode 100644 index 0000000..d251503 --- /dev/null +++ b/Pit raport po dodaniu testów/index.html @@ -0,0 +1,72 @@ + + + + + + + + +

Pit Test Coverage Report

+ +

Project Summary

+ + + + + + + + + + + + + + + + + +
Number of ClassesLine CoverageMutation CoverageTest Strength
4100%
69/69
79%
45/57
79%
45/57
+ + +

Breakdown by Package

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameNumber of ClassesLine CoverageMutation CoverageTest Strength
com.epam.bootcamp.bmi_calculator2
100%
61/61
76%
38/50
76%
38/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/Pit raport po dodaniu testów/style.css b/Pit raport po dodaniu testów/style.css new file mode 100644 index 0000000..303bfba --- /dev/null +++ b/Pit raport po dodaniu testów/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/Pit raport po testowaniu mutacyjnym/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html b/Pit raport po testowaniu mutacyjnym/com.epam.bootcamp.bmi_calculator.interfacesImplements/MetricBMI.java.html new file mode 100644 index 0000000..ffab622 --- /dev/null +++ b/Pit raport po testowaniu mutacyjnym/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.BMITest27(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.BMITest27(com.epam.bootcamp.bmi_calculator.BMITest)
Replaced double multiplication with division → KILLED

2.2
Location : setBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest27(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/Pit raport po testowaniu mutacyjnym/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html b/Pit raport po testowaniu mutacyjnym/com.epam.bootcamp.bmi_calculator.interfacesImplements/UsBMI.java.html new file mode 100644 index 0000000..2fea3dd --- /dev/null +++ b/Pit raport po testowaniu mutacyjnym/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/Pit raport po testowaniu mutacyjnym/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html b/Pit raport po testowaniu mutacyjnym/com.epam.bootcamp.bmi_calculator.interfacesImplements/index.html new file mode 100644 index 0000000..2afae5e --- /dev/null +++ b/Pit raport po testowaniu mutacyjnym/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/Pit raport po testowaniu mutacyjnym/com.epam.bootcamp.bmi_calculator/App.java.html b/Pit raport po testowaniu mutacyjnym/com.epam.bootcamp.bmi_calculator/App.java.html new file mode 100644 index 0000000..4e372d2 --- /dev/null +++ b/Pit raport po testowaniu mutacyjnym/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.BMITest37(com.epam.bootcamp.bmi_calculator.BMITest)
changed conditional boundary → KILLED

2.2
Location : ZeroChecker
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest37(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.BMITest27(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.BMITest27(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
42 + + + +

1.1
Location : calculateBMI
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest27(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.BMITest27(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.BMITest27(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
54 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest6(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.BMITest27(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

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

+
56 + + + +

1.1
Location : bmiResult
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest27(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/Pit raport po testowaniu mutacyjnym/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html b/Pit raport po testowaniu mutacyjnym/com.epam.bootcamp.bmi_calculator/GuessTheUnits.java.html new file mode 100644 index 0000000..f1e24e0 --- /dev/null +++ b/Pit raport po testowaniu mutacyjnym/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.GuessTheUnitsTest10(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.GuessTheUnitsTest11(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
changed conditional boundary → KILLED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest10(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.GuessTheUnitsTest19(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
changed conditional boundary → KILLED

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

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

+
41 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest8(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.GuessTheUnitsTest15(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
changed conditional boundary → KILLED

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

+
49 + + + +

1.1
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest27(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.GuessTheUnitsTest13(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.GuessTheUnitsTest19(com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest)
changed conditional boundary → KILLED

2.2
Location : guessUnit
Killed by : com.epam.bootcamp.bmi_calculator.GuessTheUnitsTest.GuessTheUnitsTest19(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.BMITest27(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
74 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest8(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.BMITest27(com.epam.bootcamp.bmi_calculator.BMITest)
negated conditional → KILLED

+
77 + + + +

1.1
Location : convertUnit
Killed by : com.epam.bootcamp.bmi_calculator.BMITest.BMITest27(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.GuessTheUnitsTest13(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.BMITest27(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.GuessTheUnitsTest10(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/Pit raport po testowaniu mutacyjnym/com.epam.bootcamp.bmi_calculator/index.html b/Pit raport po testowaniu mutacyjnym/com.epam.bootcamp.bmi_calculator/index.html new file mode 100644 index 0000000..c6a4805 --- /dev/null +++ b/Pit raport po testowaniu mutacyjnym/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%
61/61
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%
33/33
92%
24/26
92%
24/26
+
+ + + +
+ +Report generated by PIT 1.8.1 + + + \ No newline at end of file diff --git a/Pit raport po testowaniu mutacyjnym/index.html b/Pit raport po testowaniu mutacyjnym/index.html new file mode 100644 index 0000000..2c919cc --- /dev/null +++ b/Pit raport po testowaniu mutacyjnym/index.html @@ -0,0 +1,72 @@ + + + + + + + + +

Pit Test Coverage Report

+ +

Project Summary

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

Breakdown by Package

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameNumber of ClassesLine CoverageMutation CoverageTest Strength
com.epam.bootcamp.bmi_calculator2
100%
61/61
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/Pit raport po testowaniu mutacyjnym/style.css b/Pit raport po testowaniu mutacyjnym/style.css new file mode 100644 index 0000000..303bfba --- /dev/null +++ b/Pit raport po testowaniu mutacyjnym/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 po pierwszej modyfikacji/BMITest.java b/Testy po pierwszej modyfikacji/BMITest.java new file mode 100644 index 0000000..64321cb --- /dev/null +++ b/Testy po pierwszej modyfikacji/BMITest.java @@ -0,0 +1,202 @@ +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 BMITest12() throws Exception{ + try{ + app.setHeight(-0.01); + app.setWeight(50.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest13() throws Exception{ + try{ + app.setHeight(-1); + app.setWeight(50.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest14() throws Exception{ + try{ + app.setHeight(-11); + 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 BMITest10() throws Exception{ + try{ + app.setHeight(1); + app.setWeight(-1); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + @Test + public void BMITest11() throws Exception{ + try{ + app.setHeight(1); + app.setWeight(-300000); + 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 BMITest18() throws Exception{ + try{ + app.setHeight(5.9); + app.setWeight(60); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height and weight is in different metric."); + } + } + @Test + public void BMITest19() throws Exception{ + try{ + app.setHeight(5.1); + app.setWeight(-60); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + + @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 BMITest15() throws Exception{ + app.setHeight(6.56); + app.setWeight(2220.47); + assertEquals(app.calculateBMI(),15.743818755222017,0.5); + assertEquals(app.bmiResult(),"Thinness"); + } + @Test + public void BMITest16() throws Exception{ + app.setHeight(1.56); + app.setWeight(220.47); + assertEquals(app.calculateBMI(),90.59418145956607,0.5); + assertEquals(app.bmiResult(),"Heavily 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 BMITest17() throws Exception{ + app.setHeight(210); + app.setWeight(83); + assertEquals(app.calculateBMI(),18.820861678004533,0.0); + assertEquals(app.bmiResult(),"Normal"); + } + +} \ No newline at end of file diff --git a/Testy po pierwszej modyfikacji/GuessTheUnitsTest.java b/Testy po pierwszej modyfikacji/GuessTheUnitsTest.java new file mode 100644 index 0000000..0b778cf --- /dev/null +++ b/Testy po pierwszej modyfikacji/GuessTheUnitsTest.java @@ -0,0 +1,80 @@ +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."); + } + } + @Test + public void GuessTheUnitsTest5() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9.99,3.01); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),3.01,1); + } + @Test + public void GuessTheUnitsTest6() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9.99,2.99); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),3.01,1); + } + @Test + public void GuessTheUnitsTest7() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(99,999); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),999.0,1); + } + @Test + public void GuessTheUnitsTest8() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(101,20.0); + assertEquals(gtu.getUnitType(),"metric"); + } + @Test + public void GuessTheUnitsTest9() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(100,1000); + assertEquals(gtu.getUnitType(),"metric"); + } + @Test + public void GuessTheUnitsTest10() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(99,999); + assertEquals(gtu.getUnitType(),"US"); + } + @Test + public void GuessTheUnitsTest11() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(100,999); + assertEquals(gtu.getUnitType(),"metric"); + } + @Test + public void GuessTheUnitsTest12() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(99,1000); + assertEquals(gtu.getUnitType(),"US"); + } +} diff --git a/Testy po testowaniu mutacyjnym/BMITest.java b/Testy po testowaniu mutacyjnym/BMITest.java new file mode 100644 index 0000000..bd4b991 --- /dev/null +++ b/Testy po testowaniu mutacyjnym/BMITest.java @@ -0,0 +1,372 @@ +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 BMITest39() throws Exception{ + try{ + app.setHeight(0.001); + app.setWeight(150.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest40() throws Exception{ + try{ + app.setHeight(0.00); + app.setWeight(150.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest12() throws Exception{ + try{ + app.setHeight(-0.01); + app.setWeight(50.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest13() throws Exception{ + try{ + app.setHeight(-1); + app.setWeight(50.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest14() throws Exception{ + try{ + app.setHeight(-11); + 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 BMITest37() 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 BMITest38() throws Exception{ + try{ + app.setHeight(0); + app.setWeight(10); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest10() throws Exception{ + try{ + app.setHeight(1); + app.setWeight(-1); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + @Test + public void BMITest31() throws Exception{ + try{ + app.setHeight(0); + app.setWeight(1); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest32() 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 BMITest33() throws Exception{ + try{ + app.setHeight(188); + app.setWeight(0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + @Test + public void BMITest34() throws Exception{ + try{ + app.setHeight(188); + app.setWeight(0.0); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + @Test + public void BMITest35() throws Exception{ + try{ + app.setHeight(0); + app.setWeight(123); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest36() throws Exception{ + try{ + app.setHeight(0.0); + app.setWeight(76); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height is equals or less than zero."); + } + } + @Test + public void BMITest11() throws Exception{ + try{ + app.setHeight(1); + app.setWeight(-300000); + 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 BMITest18() throws Exception{ + try{ + app.setHeight(5.9); + app.setWeight(60); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Height and weight is in different metric."); + } + } + @Test + public void BMITest19() throws Exception{ + try{ + app.setHeight(5.1); + app.setWeight(-60); + app.calculateBMI(); + }catch(Exception e){ + assertEquals(e.getMessage(),"Weight is equals or less than zero."); + } + } + + @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 BMITest15() throws Exception{ + app.setHeight(6.56); + app.setWeight(2220.47); + assertEquals(app.calculateBMI(),15.743818755222017,0.5); + assertEquals(app.bmiResult(),"Thinness"); + } + @Test + public void BMITest16() throws Exception{ + app.setHeight(1.56); + app.setWeight(220.47); + assertEquals(app.calculateBMI(),90.59418145956607,0.5); + assertEquals(app.bmiResult(),"Heavily 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 BMITest17() throws Exception{ + app.setHeight(210); + app.setWeight(83); + assertEquals(app.calculateBMI(),18.820861678004533,0.0); + assertEquals(app.bmiResult(),"Normal"); + } + @Test + public void BMITest20() throws Exception{ + app.setHeight(5.58); + app.setWeight(1788); + assertEquals(app.calculateBMI(),18.4,1); + assertEquals(app.bmiResult(),"Thinness"); + } + @Test + public void BMITest28() throws Exception{ + app.setHeight(180); + app.setWeight(59.98); + assertEquals(app.calculateBMI(),18.5,1); + assertEquals(app.bmiResult(),"Normal"); + } + @Test + public void BMITest21() throws Exception{ + app.setHeight(180); + app.setWeight(59.5); + assertEquals(app.calculateBMI(),18.3,1); + assertEquals(app.bmiResult(),"Thinness"); + } + @Test + public void BMITest27() throws Exception{ + app.setHeight(180); + app.setWeight(60.5); + assertEquals(app.calculateBMI(),18.3,1); + assertEquals(app.bmiResult(),"Normal"); + } + @Test + public void BMITest22() throws Exception{ + app.setHeight(180); + app.setWeight(80.3); + assertEquals(app.calculateBMI(),24.78,1); + assertEquals(app.bmiResult(),"Normal"); + } + @Test + public void BMITest29() throws Exception{ + app.setHeight(180); + app.setWeight(80.6); + assertEquals(app.calculateBMI(),24.9,1); + assertEquals(app.bmiResult(),"Normal"); + } + @Test + public void BMITest25() throws Exception{ + app.setHeight(180); + app.setWeight(81); + assertEquals(app.calculateBMI(),25,1); + assertEquals(app.bmiResult(),"Overweight"); + } + @Test + public void BMITest23() throws Exception{ + app.setHeight(180); + app.setWeight(96); + assertEquals(app.calculateBMI(),29.6,1); + assertEquals(app.bmiResult(),"Overweight"); + } + @Test + public void BMITest30() throws Exception{ + app.setHeight(180); + app.setWeight(96.8); + assertEquals(app.calculateBMI(),29.9,1); + assertEquals(app.bmiResult(),"Overweight"); + } + @Test + public void BMITest24() throws Exception{ + app.setHeight(180); + app.setWeight(99); + assertEquals(app.calculateBMI(),30.6,1); + assertEquals(app.bmiResult(),"Heavily overweight"); + } + +} \ No newline at end of file diff --git a/Testy po testowaniu mutacyjnym/GuessTheUnitsTest.java b/Testy po testowaniu mutacyjnym/GuessTheUnitsTest.java new file mode 100644 index 0000000..33cfabb --- /dev/null +++ b/Testy po testowaniu mutacyjnym/GuessTheUnitsTest.java @@ -0,0 +1,127 @@ +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."); + } + } + @Test + public void GuessTheUnitsTest5() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9.99,3.01); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),3.01,1); + } + @Test + public void GuessTheUnitsTest13() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(10,3.01); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),3.01,1); + } + @Test + public void GuessTheUnitsTest14() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(10.01,3.01); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),3.01,1); + } + @Test + public void GuessTheUnitsTest6() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9.99,2.99); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),3.01,1); + } + @Test + public void GuessTheUnitsTest7() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(99,999); + assertEquals(gtu.getUnitType(),"US"); + assertEquals(gtu.getWeight(),999.0,1); + } + @Test + public void GuessTheUnitsTest8() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(101,20.0); + assertEquals(gtu.getUnitType(),"metric"); + } + @Test + public void GuessTheUnitsTest9() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(100,1000); + assertEquals(gtu.getUnitType(),"metric"); + } + @Test + public void GuessTheUnitsTest10() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(99,999); + assertEquals(gtu.getUnitType(),"US"); + } + @Test + public void GuessTheUnitsTest11() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(100,999); + assertEquals(gtu.getUnitType(),"metric"); + } + @Test + public void GuessTheUnitsTest12() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(99,1000); + assertEquals(gtu.getUnitType(),"US"); + } + @Test + public void GuessTheUnitsTest15() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(10,1000); + assertEquals(gtu.getUnitType(),"US"); + } + @Test + public void GuessTheUnitsTest16() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9,1000); + assertEquals(gtu.getUnitType(),"US"); + } + @Test + public void GuessTheUnitsTest17() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9,1001); + assertEquals(gtu.getUnitType(),"US"); + } + @Test + public void GuessTheUnitsTest18() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(9,999); + assertEquals(gtu.getUnitType(),"US"); + } + @Test + public void GuessTheUnitsTest19() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(3,1000); + assertEquals(gtu.getUnitType(),"metric"); + } + @Test + public void GuessTheUnitsTest20() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(3.,600); + assertEquals(gtu.getUnitType(),"metric"); + } + @Test + public void GuessTheUnitsTest21() throws Exception{ + GuessTheUnits gtu = new GuessTheUnits(3,1000); + assertEquals(gtu.getUnitType(),"metric"); + } +} diff --git a/początkowe testy/BMITest.java b/początkowe testy/BMITest.java new file mode 100644 index 0000000..db59600 --- /dev/null +++ b/początkowe testy/BMITest.java @@ -0,0 +1,111 @@ +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/początkowe testy/GuessTheUnitsTest.java b/początkowe testy/GuessTheUnitsTest.java new file mode 100644 index 0000000..b9d7471 --- /dev/null +++ b/początkowe testy/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