Presentation is loading. Please wait.

Presentation is loading. Please wait.

Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Project Planning Defining the Project Writing the Software Specification Selecting a Development Plan.

Similar presentations


Presentation on theme: "Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Project Planning Defining the Project Writing the Software Specification Selecting a Development Plan."— Presentation transcript:

1 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Project Planning Defining the Project Writing the Software Specification Selecting a Development Plan Selecting a Testing Plan

2 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Input-Process-Output model Define the input Define the process Define the output Define the hardware Define the development tools

3 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Input-Process-Output model Process File

4 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Define the Input What information is needed to perform the software task? What information is fixed or assumed? What information does the user provide? What information is read from files? What information is received real-time? –signals, images, responses

5 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Input Examples Subject/Patient information Stimulus parameters Spreadsheet data Image data Data acquired from recording hardware User’s choice of processing options User’s choice of output options

6 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Input Methods Graphic User Interface (GUI) Controls –radio buttons, checkboxes, pushbuttons, edit boxes, sliders, pull-down lists, menus Command line questions and answers Files (spreadsheet, image, database) Acquisition hardware –analog to digital converter boards –digital input/output boards –cameras –frame-grabbers

7 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Input Worksheet ?

8 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Define the Process What does the program do? –How does the program respond to the user’s input? –What is the sequence of events? –What computations take place? How must the units be scaled? –How must the data be manipulated?

9 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Process Examples Produce a stimulus and/or gather results Compute statistics on subject performance Filter or enhance an image Evaluate eye movement signals Evaluate neurophysiology signals Simulate a model Fit data to a model

10 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Process Methods Sequence of events –GUI control and menu selections –Control statements (if/while/for blocks) –Data driven Computations –MATLAB functions and toolboxes Stimulus generation (in memory) –Psychophysics Toolbox –Cambridge Research Systems toolbox

11 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Process Worksheet ?

12 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Define the Output Data –Results –Record of input information –Record of data processing or collection GUI –Feedback to user –Enabling/disabling controls Experiment control

13 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Output Examples Data –Experiment record and results –Simulation parameters and results –Statistical or computational results Experiment control –Stimulus and sound feedback –Triggers, shutter control –Starting/stopping devices –Capturing images or signals

14 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Output Methods Data Output –Text files –Binary files –Image files –Export to Microsoft Excel GUI output –Images –Graphical plots –Changes to what is displayed on the user interface

15 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Output Methods (continued) Experiment Control –Stimulus Presentation Psychophysics Toolbox Cambridge Research Systems libraries –Serial port control messages –Data acquisition cards and libraries –Devices that support ActiveX control

16 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Output Worksheet ?

17 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Specification StylePurposeBenefitsOrganization

18 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Specification Style Uses Present Tense –Write this document as if the project already exists, and you are describing it. This approach allows your specification to serve as: The program’s “User Guide” The foundation of your methods section in papers A visualization tool for making your program a reality Use consistent names –Name of program –Experiment parameters –Captions, column headings, descriptions

19 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Specification Purpose Document your design decisions –If programming for self: clarifies design –If hiring it done: explains to others Organize user interface design Describe equipment and tools Describe format of input and output Describe sequence of events

20 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Specification Benefits Record of design decisions –Envision “Methods” section of resulting publication –Reminder between design, testing and use Discussion tool for other users –What to include for different user needs –Arrangement and labeling of GUI Prototype for software interface –Easier to rewrite document than code

21 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Specification Organization Introduction User Interface (input, output) Parameters (input) Typical Sequence (process) Computations (process) Graphic Results (output) File Formats (input, output) References

22 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Specification “Introduction” Section Describes purpose of software Gives overview of software Introduces specific terminology Includes relevant background in literature Describes overview of hardware Describes development tools –MATLAB, Psychophysics Toolbox, etc.

23 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Specification “User Interface” Section Gives an overview of GUI layout Organization of GUI windows Arrangement of GUI controls Lists options or preferences Give brief description of purpose of each menu or control, but describe specific details in the most appropriate section that follows.

24 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Specification “Parameters” Section Describes parameters in detail –Provides details that relate to parameters (rather than in GUI section) –purpose –units –default values –acceptable ranges Summarize parameters in a table for quick reference

25 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Specification “Typical Sequence” Section Describes the typical sequence of events Describes what happens when the user makes different selections Describes error handling For repeating operations, (psychophysics trials, batch processes) describes sequence as a numbered list

26 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Specification “Computations” Section Describe computations as you would in the methods section of a paper Supply all necessary information to perform the computations For extensive, complex computations –Reference descriptive documents –Reference existing software –Give details in an appendix rather than make this section excessively long

27 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Specification “Graphic Results” Section Plots –Axes and scaling –Axes titles –Markers and lines Images –Data format (uint8, double, indexed) –True color or colormap preferences –Meaning of intensity scale –Overlays (i.e. pupil boundary, centroids)

28 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Specification “File Formats” Section Includes both input and output file formats Describes the rows and columns of tab- delimited text files or Excel output Identifies graphic file format (TIFF, JPG) Describes any naming conventions Indicates if files are to be overwritten or appended

29 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Specification “References” Section Contact information for software tools Contact information for special hardware References to related manuals –hardware –software References to related publications –computations –experiment methods

30 Feb. 8, 2008 UHCO Graduate Course in MATLAB Development Plan The Chronological Approach The Availability Approach The Feasibility Approach The Generic Approach The ‘They Did It This Way’ Approach Select a Plan

31 Feb. 8, 2008 UHCO Graduate Course in MATLAB Development Plan The Chronological Approach Add each block of code in sequential order –First write code that receives all the inputs –Next write code that does first stage processing –Next add code that depends on first stage –Continue until all results are available –Produce results and record them to files

32 Feb. 8, 2008 UHCO Graduate Course in MATLAB Development Plan The Availability Approach Some code depends on hardware. Write that code when new hardware arrives or when existing hardware is not otherwise scheduled for subjects. Some code depends on software. Order software tools early. Write user interface code or file formatting code at any time.

33 Feb. 8, 2008 UHCO Graduate Course in MATLAB Development Plan The Feasibility Approach Sometimes it is not clear that a new experiment system or simulation will work. If it does not, then there is no purpose to adding a fancy user interface or producing output files. Start with the part that you are least confident will work. Once you prove that part works, the rest of the program development is worth the effort.

34 Feb. 8, 2008 UHCO Graduate Course in MATLAB Development Plan The Generic Approach If you must wait on some aspect of software design, it can be beneficial to write routines that you expect to use over and over: –Writing or reading standard file types –Unit or file conversions –Subject response or feedback methods –Standard stimuli

35 Feb. 8, 2008 UHCO Graduate Course in MATLAB Development Plan “They Did It This Way” Research software can often be changed in minor ways to perform similar yet distinct experiments. Re-using code can save time. Be sure to UNDERSTAND the content and format of the parameters and results for existing code that you re-use.

36 Feb. 8, 2008 UHCO Graduate Course in MATLAB Development Plan Choose a Plan Choose a Plan –Considering all the constraints and approaches, decide what parts of your code to implement, in what order. –Estimate how long each part will require for coding –Keep the scope realistic

37 Feb. 8, 2008 UHCO Graduate Course in MATLAB Testing Plan All software has “bugs” Create a plan for testing, based on –Definition of the program’s inputs, processes and outputs –Software Specification Error checking is a subset of testing –Include error checking as a part of your testing plan, to verify that your software handles potential errors well

38 Feb. 8, 2008 UHCO Graduate Course in MATLAB Testing Plan Input-Process-Output Model Verify Inputs –Do files open properly? Is it open in another application? –Identify bad file formats Did user open the wrong text file? –Did the user type incorrectly? –Did the user forget to enter some information? –Do the input devices initialize properly? –Create situations that fail

39 Feb. 8, 2008 UHCO Graduate Course in MATLAB Testing Plan Input-Process-Output Model Verify Processes –Computations: start with data sets that produce known results –Break up complex processes into smaller units that can be tested on their own –Unit conversions: display intermediate results

40 Feb. 8, 2008 UHCO Graduate Course in MATLAB Testing Plan Input-Process-Output Model Verify Outputs –Measure brightness/size/timing of stimuli –Examine output files with another application Always examine first runs of a new release before starting full-scale collection for a study –Compare results with expected results from known data sets

41 Feb. 8, 2008 UHCO Graduate Course in MATLAB Testing Plan Compare with Specification User Interface: Ask naïve users to try your program Parameters: Does the program alert users to invalid values? Computations Graphic Results File Formats

42 Feb. 8, 2008 UHCO Graduate Course in MATLAB Testing Plan MATLAB Methods Remove semicolons and view values –If removing the semicolon generates too much output, use disp() to show specific results that are meaningful Generate intermediate.mat files that verify each step of your process Use tic and toc to verify timing Examine the return value from functions that provide status or error codes

43 Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Project Planning Conclusions –Define the software as clearly as possible before starting the code. It is generally easier to write the documents than the code Input-Process-Output worksheets Formal Specification –Plan Development and Testing Define managable stages and steps Incorporate testing into design of code

44 Feb. 8, 2008 UHCO Graduate Course in MATLAB Thanks for your attention. Questions?

45 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Input Worksheet ?

46 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Process Worksheet ?

47 Feb. 8, 2008 UHCO Graduate Course in MATLAB Defining the Project Output Worksheet ?


Download ppt "Feb. 8, 2008 UHCO Graduate Course in MATLAB Software Project Planning Defining the Project Writing the Software Specification Selecting a Development Plan."

Similar presentations


Ads by Google