JUnit Test Generator Sergio Alcocer Vzquez ( C00132732 ) I.T. - - PowerPoint PPT Presentation

junit test generator
SMART_READER_LITE
LIVE PREVIEW

JUnit Test Generator Sergio Alcocer Vzquez ( C00132732 ) I.T. - - PowerPoint PPT Presentation

JUnit Test Generator Sergio Alcocer Vzquez ( C00132732 ) I.T. Carlow JUnit Test Generator Content What is Xunit and JUnit? How the application would work? Examples Screenshots Questions What is Xunit and Junit? XUnit


slide-1
SLIDE 1

Sergio Alcocer Vázquez ( C00132732 ) I.T. Carlow

JUnit Test Generator

slide-2
SLIDE 2

JUnit Test Generator

  • Content

What is Xunit and JUnit? How the application would work? Examples Screenshots Questions

slide-3
SLIDE 3

What is Xunit and Junit?

  • XUnit

– PHPUnit – PyUnit – CUnit – JUnit

slide-4
SLIDE 4

How the application would work?

  • First

– Load Java File – Obtain package and imports – Recognize class... :

  • Name
  • Attributes
  • Methods and their parameters
  • Constructors and their parameters
slide-5
SLIDE 5

How the application would work?

  • Second

– Load data from file (if any)

  • Check if fields and methods matches
  • Add Test Cases

– Allow the user add, modify and delete Test

Cases

slide-6
SLIDE 6

How the application would work?

  • Third

– Generate the Class Test (.java) – Run it and prompt the output (success or failure)

  • Fourth

– Save Test Cases in a file

slide-7
SLIDE 7

How the application would work?

  • Alternative

– As a wizard

  • Ask the user for...:

– Methods – Attributes – Test Cases, etc

  • Generate application skeleton
  • Generate Class Test
slide-8
SLIDE 8

How the application would work?

slide-9
SLIDE 9

Examples

pac kage book; public c las s Book { private S tring title; private double price; public Book(S tring title); public boolean equals(Objec t object); public S tring getTitle(); public void setTitle(S tring title); }

slide-10
SLIDE 10

Examples

pac kage test.book; import book.Book; import junit.framework.*; public c las s BookTest extends TestCase{ private Book book1, book2; public BookTest(String name); protec ted void setUp() throws Exception; protec ted void tearDown() throws Exception; public void testGetTitle(); public s tatic Test suite(); }

slide-11
SLIDE 11

Screenshots

slide-12
SLIDE 12

JUnit Test Generator

Thanks for your attention. Any Questions? Sergio Alcocer Vázquez