Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © 2010 – MICS 2010, Curt Hill Instructor Tools: Test Data Generation Curt Hill Valley City State University.

Similar presentations


Presentation on theme: "Copyright © 2010 – MICS 2010, Curt Hill Instructor Tools: Test Data Generation Curt Hill Valley City State University."— Presentation transcript:

1 Copyright © 2010 – MICS 2010, Curt Hill Instructor Tools: Test Data Generation Curt Hill Valley City State University

2 Introduction The production of test data is important to anyone with programming responsibility The commercial requirements are more stringent than in academia –That does not make us exempt A significant part of my load is teaching classes with a serious programming component Copyright © 2010 – MICS 2010, Curt Hill

3 Presentation Why test data generators? Features Availability Case studies Copyright © 2010 – MICS 2010, Curt Hill

4 How to obtain test data? Typically three approaches Extract live data –Not available for most instructors –Privacy issues require some sanitization Test data generators –Generates volume, not necessarily quality Generate suitable data by hand –Tedious –May insure coverage –Often used to augment others Copyright © 2010 – MICS 2010, Curt Hill

5 Why Test Data Generators? Large is often better –Has potential to expose a variety of run- time issues Duplicate sets of data –Publish a small test set –Use a different set for grading Change the format for similar programs in different terms –Tends to suppress previous solutions Copyright © 2010 – MICS 2010, Curt Hill

6 Features? What features are needed for a good test data generator Large number of types Easy to specify Savable specifications Copyright © 2010 – MICS 2010, Curt Hill

7 Specifications Like a database each field needs a specification –Type – not programming language type –Format –Position – usually entry order –Length – may be inferred We would also like it to be easy to specify these Savable Automatic from database is best Copyright © 2010 – MICS 2010, Curt Hill

8 Types Numeric Names People Products Companies Locations Dates Constant User specified Sequence or unique Copyright © 2010 – MICS 2010, Curt Hill

9 Desirable Large dictionaries of names Many formats of names or dates Large number of types External or binary Interface to a database Copyright © 2010 – MICS 2010, Curt Hill

10 Availability There are variety of both commercial and free programs –See the paper for URLs Two free programs will be considered One on the web My own Copyright © 2010 – MICS 2010, Curt Hill

11 Case Study 1 http://www.generatedata.com Written in JavaScript and PhP May be downloaded In most cases just using the web version is quite adequate Next screens shows the generation of simple line oriented data –Integer –Name Copyright © 2010 – MICS 2010, Curt Hill

12 Initially Copyright © 2010 – MICS 2010, Curt Hill

13 Selecting an Integer Copyright © 2010 – MICS 2010, Curt Hill

14 Set the Range Copyright © 2010 – MICS 2010, Curt Hill

15 Add Name Copyright © 2010 – MICS 2010, Curt Hill

16 Format of the Name Copyright © 2010 – MICS 2010, Curt Hill

17 Generating Copyright © 2010 – MICS 2010, Curt Hill Specify format, delimiter and count

18 Save Copyright © 2010 – MICS 2010, Curt Hill

19 Case Study 2 This uses my own windows program http://community.vcsu.edu/facultypage s/curt.hill/My_Webpage/download.htm Must be downloaded and installed, but still free Has some capabilities lacking in previous Consider the following problem: Copyright © 2010 – MICS 2010, Curt Hill

20 Sales Records Limited number of products Limited number of sales representatives Limited number of companies Large number of records What’s wrong with this picture? Most generators will produce either of these only once or twice Copyright © 2010 – MICS 2010, Curt Hill

21 Initially Copyright © 2010 – MICS 2010, Curt Hill

22 An ID Copyright © 2010 – MICS 2010, Curt Hill

23 The Specifications Copyright © 2010 – MICS 2010, Curt Hill

24 Generating Copyright © 2010 – MICS 2010, Curt Hill

25 Picture of first file Copyright © 2010 – MICS 2010, Curt Hill

26 Second File – Third Field Copyright © 2010 – MICS 2010, Curt Hill

27 Combining Copyright © 2010 – MICS 2010, Curt Hill

28 What is this? This step does a partial random Cartesian Product The second file is read into memory The first file is then processed sequentially Each record is randomly paired with a line from second file –Repeated a random number of times Copyright © 2010 – MICS 2010, Curt Hill

29 Picture of New File Copyright © 2010 – MICS 2010, Curt Hill

30 Commentary There are only 50 Sales Representatives There are only 50 Products Both of the above have a unique ID About 900 records Lots of program possibilities Database assign using Select Into Copyright © 2010 – MICS 2010, Curt Hill

31 Conclusion A handy thing to have Copyright © 2010 – MICS 2010, Curt Hill

32 Questions? Curt.Hill@vcsu.edu Copyright © 2010 – MICS 2010, Curt Hill


Download ppt "Copyright © 2010 – MICS 2010, Curt Hill Instructor Tools: Test Data Generation Curt Hill Valley City State University."

Similar presentations


Ads by Google