• Tidak ada hasil yang ditemukan

BAB VI KESIMPULAN DAN SARAN

6.2 Saran

Penulis menyarankan untuk pengembangan penelitian selanjutnya agar menjadi lebih baik lagi, karena penelitian ini masih memiliki banyak keterbatasan. Berikut ini saran penulis untuk pengembangan selanjutnya:

1. Melakukan pengujian terhadap pemograman berorientasi objek.

2. Melakukan perbandingan terhadap algoritma pencarian untuk melakukan pengujian.

3. Merancang tool pengujian untuk bahasa Java dengan metode pencarian berbasis algoritma genetika.

60

DAFTAR PUSTAKA

Ali, M. and Fairouz, T. (2015) Software Testing Concepts and Operations, John Wiley & Sons. Edited by L. Bernstein. Hoboken, NewJersey: John Wiley &

Sons, Inc.,. doi: 10.1007/s13398-014-0173-7.2.

Chen, T. Y. et al. (2013) ‘Code coverage of adaptive random testing’, IEEE Transactions on Reliability, 62(1), pp. 226–237. doi:

10.1109/TR.2013.2240898.

Chitirala, S. (2015) Comparing the effectiveness of automated test generation tools

‘EVOSUITE’ and ‘Tpalus’. Available at:

http://www.d.umn.edu/cs/degrees/grad/documents/SaiCharanChitiralaThesis July2015.pdf.

Coles, Henry (2017). Pitest: Mutation Testing Tools: Retrieved: http://pitest.org/

EvoSuite (2012). EvoSuite: Automati Test Suite Generation for Java: Retrieved:

http://study.evosuite.org/2013/ISSTA2013

Fraser, G. and Arcuri, A. (2011) ‘Evolutionary Generation of Whole Test Suites’, 2011 11th International Conference on Quality Software, pp. 31–40. doi:

10.1109/QSIC.2011.19.

Fraser, G. and Arcuri, A. (2013) ‘Whole Test Suite Generation’, IEEE Transactions on Software Engineering, 39(2), pp. 276–291. doi: 10.1109/TSE.2012.14.

Fraser, G. and Arcuri, A. (2014) ‘A Large Scale Evaluation of Automated Unit Test Generation Using EvoSuite’, ACM Transactions on Software Engineering and Methodology (TOSEM), 24(2), p. 8.

Fraser, G. and Arcuri, A. (2015) ‘EvoSuite at the SBST 2015 Tool Competition’, Proceedings - 8th International Workshop on Search-Based Software Testing, SBST 2015, pp. 25–27. doi: 10.1109/SBST.2015.13.

Fraser, G. and Zeller, A. (2012) ‘Mutation-driven generation of unit tests and oracles’, IEEE Transactions on Software Engineering, 38(2), pp. 278–292.

doi: 10.1109/TSE.2011.93.

Frier, J. (2017) Genetic Algorithms as a Viable Method of Obtaining Branch Coverage by. UNIVERSITY OF NORTH FLORIDA SCHOOL OF COMPUTING.

Galler, S. J. and Aichernig, B. K. (2014) ‘Survey on test data generation tools: An evaluation of white- and gray-box testing tools for C#, C++, Eiffel, and Java’, International Journal on Software Tools for Technology Transfer, 16(6), pp.

UIN Syarif Hidayatullah Jakarta

727–751. doi: 10.1007/s10009-013-0272-3.

Harman, M. et al. (2012) ‘Search Based Software Engineering: Techniques, Taxonomy, Tutorial’, Search, 2012, pp. 1–59. doi: 10.1007/978-3-642-25231-0_1.

Harman, M., Jia, Y. and Zhang, Y. (2015) ‘Achievements , Open Problems and Challenges for Search Based Software Testing’, Proceedings of the 8th IEEE International Conference on Software Testing, Verification and Validation (ICST’15), (Icst), pp. 1–12. doi: 10.1109/ICST.2015.7102580.

JUnit (2017, Januari). JUnit: JUnit Framework: Retrieved from http://junit.org/junit4/

Kaczanowski, T. (2012) Practical unit testing with testNG and Mockito.

Kausar, M. A., Nasar, M. and Singh, S. K. (2013) ‘A Detailed Study on Information Retrieval using Genetic Algorithm’, Journal of Industrial and Intelligent Information, 1(3), pp. 122–127. doi: 10.12720/jiii.1.3.122-127.

Khan, R. and Amjad, M. (2015) ‘Automatic test case generation for unit software testing using genetic algorithm and mutation analysis’, 2015 IEEE UP Section Conference on Electrical Computer and Electronics (UPCON), (December 2015), pp. 1–5. doi: 10.1109/UPCON.2015.7456734.

Khoirunissa (2017) COMPARATIVE ANALYSIS OF STATEMENT , BRANCH , AND LOOP COVERAGE IN SOFTWARE TESTING USING GENETIC ALGORITHM COMPARATIVE ANALYSIS OF STATEMENT , BRANCH , AND LOOP COVERAGE IN SOFTWARE TESTING USING.

Kuar, A. and Goyal, S. (2011) ‘A genetic algorithm for regression test case prioritization using code coverage A GENETIC ALGORITHM FOR REGRESSION TEST CASE PRIORITIZATION USING CODE’, International Journal on Computer Science and Engineering(IJCSE), 3(March), pp. 1839–1847.

Kumar, R., Singh, S. and Gopal, G. (2013) ‘Automatic Test Case Generation Using Genetic Algorithm’, International Journal of Scientific & Engineering Research, Volume 4, Issue 6, June-2013 ISSN, 4(3), pp. 4–7.

Ma, L. et al. (2015) ‘An Empirical Study on Effects of Code Visibility on Code Coverage of Software Testing’, Proceedings - 10th International Workshop on Automation of Software Test, AST 2015, pp. 80–84. doi:

10.1109/AST.2015.23.

62

UIN Syarif Hidayatullah Jakarta

Mahadik, P. P. and Thakore, D. M. (2016) ‘Search-based junit test case generation of code using object instances and genetic algorithm’, International Journal of Software Engineering and its Applications, 10(5), pp. 95–108. doi:

10.14257/ijseia.2016.10.5.10.

McMinn, P. (2011) ‘Search-Based Software Testing: Past, Present and Future’, pp.

153–163. doi: 10.1109/ICSTW.2011.100.

Pang, Y., Xue, X. and Namin, A. S. (2013) ‘Identifying effective test cases through K-means clustering for enhancing regression testing’, Proceedings - 2013 12th International Conference on Machine Learning and Applications, ICMLA 2013, 2, pp. 78–83. doi: 10.1109/ICMLA.2013.109.

Paul C. Jorgensen (2014) Software Testing A Craftsman’s Approach. Fourth Edi, Guest Editors Introduction, IEEE Computer. Fourth Edi. doi:

10.1109/TEST.1991.519785.

Saha, R. K. et al. (2014) ‘REPiR : An Information Retrieval based Approach for Regression Test Prioritization’, FSE ’14, Hongkong.

Samatha, K., Chokkadi, S. and Yogananda, J. (2012) ‘A Genetic Algorithm Approach for Test Case Optimization of Safety Critical Control’, Procedia Engineering, 38, pp. 647–654. doi: 10.1016/j.proeng.2012.06.080.

Satrio, C. D., Saputra, M. C. and Rachmadi, A. (2017) ‘Perbandingan Test Case Generation dengan Pendekatan Genetic Algorithm Mutation Analysis dan Sampling’, 2(1).

Shamshiri, S. et al. (2015) ‘Random or Genetic Algorithm Search for Object-Oriented Test Suite Generation ?’, Proceedings of the 2015 Annual Conference on Genetic and Evolutionary Computation, pp. 1367–1374. doi:

10.1145/2739480.2754696.

Stein, D. (2016) Graph-Based Source Code Analysis of JavaScript Repositories.

Budapest University of Technology and Economic.

Sudheer, N., Sharma, V. and Raju, S. H. (2016) ‘A Process Web Application Testing Using TAO Tool Search Based Genetic Algorithm’, (7).

SVV Lab (2016). Mark Harman - Recent Advances in Search Based Software Testing and Genetic Improvement: Retrieved from https://www.youtube.com/watch?v=y4xWZj1ocDo&t=1526s

Zhang, S. (2014) Effective Program Analyses for Automated Software Testing and Error Diagnosis.

UIN Syarif Hidayatullah Jakarta

LAMPIRAN

Lampiran 1- Source Code Triangle

1 import java.io.*;

2

3 //Class pertama 4 class Triangle { 5

6 // Stores the length of each side of the Triangle object. (atribut) 7 private int side1, side2, side3;

8

9 //Method konstruktor dengan parameter int s1, int s2, int s3 10 public Triangle (int s1, int s2, int s3) {

16 //Method fungsi untuk menguji segitiga siku-siku.

17 public boolean is_right () {

26 //Method fungsi untuk menguji segitiga sembarang.

27 public boolean is_scalene () {

34 //Method fungsi untuk menguji segitiga sama kaki.

35 public boolean is_isosceles () {

36 if (((side1 == side2) && (side1 != side3)) ||

64

UIN Syarif Hidayatullah Jakarta

42 } 43

44 //Method fungsi untuk menguji segitiga sama sisi.

45 public boolean is_equilateral () {

46 if ((side1 == side2) && (side1 == side3))

54 class Test_Triangle { 55

56 public static void main (String[] args) throws IOException { 57

58 // Declare stdin so data can be read from input.

59 DataInputStream stdin = new DataInputStream (System.in);

60

61 // loop exits when the user response is "n"

62 String user_response = "y";

63 while (!user_response.equals("n")) { 64

65 // Ask user for 3 dimensions of triangle.

66 System.out.println ("\nEnter side1 length: ");

67 int side1 = Integer.parseInt (stdin.readLine());

68

69 System.out.println ("Enter side2 length: ");

70 int side2 = Integer.parseInt (stdin.readLine());

71

72 System.out.println ("Enter side3 length: ");

73 int side3 = Integer.parseInt (stdin.readLine());

74

75 // Now use these values to create a Triangle object.

76 Triangle tri = new Triangle (side1,side2,side3);

77

78 // Determine what kind of triangle it is.

79 System.out.println ("\nIs triangle right-angle? "+tri.is_right());

80 System.out.println ("Is triangle scalene? "+tri.is_scalene());

81 System.out.println ("Is triangle isosceles? "+tri.is_isosceles());

82 System.out.println ("Is triangle equilateral? "+tri.is_equilateral());

83 // Ask user if they want to continue.

84 System.out.println ("\nDo you want to examine more triangles?");

85 System.out.println ("(type 'y' for yes or 'n' for no)");

86 user_response = stdin.readLine();

87 }

UIN Syarif Hidayatullah Jakarta

88 } 89 }

66

UIN Syarif Hidayatullah Jakarta

Lampiran 2- Test Case Pengujian Otomatis SBST /*

* This file was automatically generated by EvoSuite * Fri Aug 18 01:19:23 ICT 2017

*/

import static org.junit.Assert.assertFalse;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class Triangle_ESTest { @Test(timeout = 4000)

assertFalse(triangle0.is_scalene());

}

@Test(timeout = 4000)

public void test03() throws Throwable { Triangle triangle0 = new Triangle(0, 0, 0);

boolean boolean0 = triangle0.is_scalene();

assertFalse(triangle0.is_isosceles());

assertFalse(boolean0);

}

@Test(timeout = 4000)

public void test04() throws Throwable { Triangle triangle0 = new Triangle(0, (-1), 0);

boolean boolean0 = triangle0.is_scalene();

assertFalse(boolean0);

assertFalse(triangle0.is_right());

UIN Syarif Hidayatullah Jakarta

}

@Test(timeout = 4000)

public void test05() throws Throwable { Triangle triangle0 = new Triangle(0, (-1), 1);

boolean boolean0 = triangle0.is_scalene();

assertTrue(triangle0.is_right());

assertTrue(boolean0);

}

@Test(timeout = 4000)

public void test06() throws Throwable {

Triangle triangle0 = new Triangle(0, (-1381), (-1381));

boolean boolean0 = triangle0.is_scalene();

assertTrue(triangle0.is_right());

assertFalse(boolean0);

}

@Test(timeout = 4000)

public void test07() throws Throwable { Triangle triangle0 = new Triangle(0, (-1), 0);

boolean boolean0 = triangle0.is_isosceles();

assertFalse(triangle0.is_right());

assertTrue(boolean0);

}

@Test(timeout = 4000)

public void test08() throws Throwable { Triangle triangle0 = new Triangle(0, 0, 0);

boolean boolean0 = triangle0.is_isosceles();

assertFalse(boolean0);

}

@Test(timeout = 4000)

public void test09() throws Throwable {

Triangle triangle0 = new Triangle(736, 736, 0);

boolean boolean0 = triangle0.is_isosceles();

assertTrue(boolean0);

assertTrue(triangle0.is_right());

}

@Test(timeout = 4000)

public void test10() throws Throwable { Triangle triangle0 = new Triangle(0, (-1), 1);

boolean boolean0 = triangle0.is_isosceles();

assertTrue(triangle0.is_right());

assertFalse(boolean0);

}

@Test(timeout = 4000)

public void test11() throws Throwable {

Triangle triangle0 = new Triangle(0, (-1381), (-1381));

boolean boolean0 = triangle0.is_isosceles();

68

UIN Syarif Hidayatullah Jakarta

assertTrue(boolean0);

assertTrue(triangle0.is_right());

}

@Test(timeout = 4000)

public void test12() throws Throwable { Triangle triangle0 = new Triangle(0, (-1), 0);

boolean boolean0 = triangle0.is_equilateral();

assertFalse(boolean0);

assertFalse(triangle0.is_right());

}

@Test(timeout = 4000)

public void test13() throws Throwable { Triangle triangle0 = new Triangle(0, 0, 0);

boolean boolean0 = triangle0.is_equilateral();

assertTrue(boolean0);

}

@Test(timeout = 4000)

public void test14() throws Throwable {

Triangle triangle0 = new Triangle(736, 736, 0);

boolean boolean0 = triangle0.is_equilateral();

assertTrue(triangle0.is_right());

assertFalse(boolean0);

assertFalse(triangle0.is_scalene());

} }

UIN Syarif Hidayatullah Jakarta

Lampiran 3- Test Case Pengujian Otomatis import org.junit.*;

import static org.junit.Assert.*;

/**

* The class <code>TriangleTest</code> contains tests for the class <code>{@link Triangle}</code>.

*

* @generatedBy CodePro at 11/17/17 12:19 AM * @author macia hauna

* @version $Revision: 1.0 $ */

public class TriangleTest { @Test

public void testTriangle_1()

throws Exception {

assertNotNull(result);

assertEquals(true, result.is_equilateral());

assertEquals(false, result.is_isosceles());

assertEquals(false, result.is_right());

assertEquals(false, result.is_scalene());

} @Test

public void testIs_equilateral_1()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_equilateral();

// add additional test code here

assertEquals(true, result);

} @Test

public void testIs_equilateral_2()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_equilateral();

70

UIN Syarif Hidayatullah Jakarta

// add additional test code here

assertEquals(true, result);

} @Test

public void testIs_equilateral_3()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_equilateral();

// add additional test code here

assertEquals(true, result);

} @Test

public void testIs_isosceles_1()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_isosceles();

// add additional test code here assertEquals(false, result);

} @Test

public void testIs_isosceles_2()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_isosceles();

// add additional test code here assertEquals(false, result);

} @Test

public void testIs_isosceles_3()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_isosceles();

// add additional test code here assertEquals(false, result);

} @Test

public void testIs_isosceles_4()

UIN Syarif Hidayatullah Jakarta

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_isosceles();

// add additional test code here assertEquals(false, result);

} @Test

public void testIs_isosceles_5()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_isosceles();

// add additional test code here assertEquals(false, result);

} @Test

public void testIs_right_1()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_right();

// add additional test code here assertEquals(false, result);

} @Test

public void testIs_right_2()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_right();

// add additional test code here assertEquals(false, result);

} @Test

public void testIs_right_3()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_right();

// add additional test code here

72

UIN Syarif Hidayatullah Jakarta

assertEquals(false, result);

} @Test

public void testIs_right_4()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_right();

// add additional test code here assertEquals(false, result);

} @Test

public void testIs_scalene_1()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_scalene();

// add additional test code here assertEquals(false, result);

} @Test

public void testIs_scalene_2()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_scalene();

// add additional test code here assertEquals(false, result);

} @Test

public void testIs_scalene_3()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

boolean result = fixture.is_scalene();

// add additional test code here assertEquals(false, result);

} @Test

public void testIs_scalene_4()

throws Exception {

Triangle fixture = new Triangle(1, 1, 1);

UIN Syarif Hidayatullah Jakarta

boolean result = fixture.is_scalene();

// add additional test code here assertEquals(false, result);

}

@Before

public void setUp()

throws Exception {

// add additional set up code here }

@After

public void tearDown()

throws Exception {

// Add additional tear down code here }

public static void main(String[] args) {

new org.junit.runner.JUnitCore().run(TriangleTest.class);

} }

74

UIN Syarif Hidayatullah Jakarta

Lampiran 4- Test Case Pengujian Manual import static org.junit.Assert.*;

import org.junit.Test;

public class TriangleTest { @Test

public void testIs_Right() {

Triangle test = new Triangle(3,4,5);

boolean booleantest = test.is_right();

assertTrue(booleantest);

} @Test

public void testIs_Scalene() {

Triangle test = new Triangle(7,10,3);

boolean booleantest = test.is_scalene();

assertTrue(booleantest);

}

@Test

public void testIs_Isosceles() {

Triangle test = new Triangle(5,3,5);

boolean booleantest = test.is_isosceles();

assertTrue(booleantest);

} @Test

public void testIs_Equilateral() {

Triangle test = new Triangle(10,10,10);

boolean booleantest = test.is_equilateral();

assertTrue(booleantest);

} }

UIN Syarif Hidayatullah Jakarta

Lampiran 5- Bobot Graph

76

UIN Syarif Hidayatullah Jakarta

Lampiran 6- Mutant Program Hasil PIT Mutation Test Line

Program

Program Triangle M Mutant Program

18 if (((side1*side1) == ((side2*side2) + (side3*side3)))

M1 if (((side1/side1) != ((side2/side2) - (side3/side3)))

19 ((side2*side2) == ((side1*side1) + (side3*side3)))

M2 ((side2/side2) != ((side1/side1) -(side3/side3)))

20 ((side3*side3) == ((side1*side1) + (side2*side2))))

M3 ((side3/side3) != ((side1/side1) - (side2/side2))))

21 return true; M4 return (x == 0? 1:0)

23 return false M5 return (x == 0? 1:0)

28 if ((side1 != side2) && (side1 !=

side3) && (side2 != side3))

M6 if ((side1 = side2) || (side1 == side3)

&& (side2 == side3))

29 return true; M7 return (x == 0? 1:0)

Dokumen terkait