Presentation is loading. Please wait.

Presentation is loading. Please wait.

+ Auto-Testing Code for Teachers & Beginning Programmers Dr. Ronald K. Smith Graceland University.

Similar presentations


Presentation on theme: "+ Auto-Testing Code for Teachers & Beginning Programmers Dr. Ronald K. Smith Graceland University."— Presentation transcript:

1 + Auto-Testing Code for Teachers & Beginning Programmers Dr. Ronald K. Smith Graceland University

2 + Introduction My story

3 + Beginning Programmers 1....seldom understand the importance of writing robust code. 2....generally believe the programming task ends with the first syntax–error free run 3....have no idea how to design good test data sets.

4 + Beginning programmer teachers 1....spend inordinate amounts of time grading code that either doesn't work or works only on one specific example. 2....don't have time to run student programs on multiple sets of data. 3....often end up testing student programs on non-uniform data sets.

5 + Wouldn't it be nice if......teachers had an easy way to design and save data sets for testing programs?...graders could test programs on multiple sets of data simultaneously?...students could "blind test" programs on good data sets, getting helpful feedback without seeing the actual data sets?... programs worked before being submitted for grading?

6 + AutoTest System overview

7 + AutoTest MasterGraderStudent Designs Problems & Data Sets Grades Student Programs Writes Programs "Blind tests" Data

8 + Master View The master Writes problem specs, including input and output. Writes a master program. Designs multiple test data sets. AutoTest Generates a master file containing each data set and its corresponding output.

9 + Student view A Student Writes a program to meet I/O specs. Tests the program with the sample data set and corresponding output provided with the problem. AutoTest Matches a master file to the student program and compares output from each master data set to the output in the master file in a summary table.

10 + Grader View Grader Chooses a master file Sets the comparison level (strict, ignore white space, etc.) Selects the folder containing student program folders. Autotest Displays the student program, student output on each data set, and a summary table.

11 + Example

12 + Problem Specs

13 + Master Program

14 + Data Sets Sample Data Zero Lines Blank Lines Single line Names hint at aspect tested.

15 + Master View "File Input" opens existing master file. "File Output" generates output. "Save Master" encodes all the info into a single text file.

16 + (Coded) Master File This file is distributed to student machines along with a compiled student version of AutoTest. I2VjaG8gNQojU2FtcGxlIERhdGEKSGVsbG8gV29ybGQhCiNOdW1lc mljYWwKNDIKI0VtcHR5IExpbmUKCiNFeHRyYSBJbnB1dApMaW5lIDE KTGluZSAyCiNlbmQgaW5wdXQKI1NhbXBsZSBEYXRhCkhlbGxvIFdvc mxkIQoKI051bWVyaWNhbAo0MgoKI0VtcHR5IExpbmUKCgojRXh0c mEgSW5wdXQKTGluZSAxCgojZW5kIG91dHB1dA==

17 + Grader View Current Program Current Output Comparison Level Summary

18 + Some Programs have small errors. Student left out a required space after line numbers. Rerunning at the "letters" level shows formatting is the only error. At the "Exact" level, only one set is error free.

19 + Some bugs cannot be ignored. This program had an undefined variable name in the print statement.

20 + Student View Comparison Level Summary Student View = Grader Vew –( Program & Output)

21 + Implementation

22 + Some Nuts and Bolts A compiled version (.pyc) of AutoTest along with a script (.bat) file with which to execute it is distributed to each computer in the CSIT lab. Students make a shortcut to the AutoTest program and store it in a folder in which they will be testing programs. AutoTest uses digits in the program name to match appropriate master files. Finished programs are uploaded using my.graceland.edu. When downloaded, each program is in a folder with the student name, ready for batch processing with AutoTest. New Master files are distributed each time an assignment is made.

23 + Security AutoTest is written in Python, so it is virtually platform independent. I used to distribute copies to the lab machines, and did not tell the students about the master files (which were base 64 coded). Last year, one of my students asked me about base 64 coding, having gone through the code to hack the system! We considered a web-based solution, but allowing any Python program to run from the web is very insecure.

24 + Summary

25 + AutoTest Is a GUI interface to a system with 3 views: Master Grader Student Facilitates testing/grading of programs with multiple data sets simultaneously.

26 + Advantages Beginning students are encouraged to write more robust code. Students can verify that I/O specs are met before turning in their programs. Program are tested on multiple data sets. Program grades are based on uniform tests. Files containing multiple data sets with input and output are easily made and edited. Program output can be checked with various matching criteria. Most programs turned in work! Grades can be based on other criteria. Everyone wins

27 +


Download ppt "+ Auto-Testing Code for Teachers & Beginning Programmers Dr. Ronald K. Smith Graceland University."

Similar presentations


Ads by Google