CSE 5306-2 Lab Insights Rapid Prototyping • Agile software designers do the hardest parts of their projects first. • Software analysts very quickly develop a series of simple models (rapid prototypes) of a customer’s concepts to elicit her requirements. • Nontechnical customers cannot clearly verbalize technical requirements to software designers. (Nor can software designers paint portraits.) • But customers know what they like, when they see it. And they can conceptually verbalize what is wrong with each prototype demonstration. MATLAB Simulations • Start with those parts of each performance demonstration that are 1) easiest to code and 2) the customer feels are most important. • Lab 1 example: – A simple script (not a function) with fprintf (or disp) functions would earn you about 80%. – disp(‘myBalance yourBalance myChex’) – disp(‘100 0’) – disp(’40 0 150’) – disp(‘Overdraft!’) – disp(’20 20 20’) Bridge to the Software Designer • The designer says, “But you have only written a test case and its correct results. …How does the system work?” • Answer: rapidly prototype the logic in function(s), most of which already appear in MATLAB’s very extensive library. (Thinkers always should browse “Help” diligently!) • Lab 1 example—repeatedly invoke the following function in the Command Window to earn a 85% grade: – – – – – – – – function [ myAcct urAcct ] = banksvr( myChex ) urAcct = urAcct + myChex % your deposit… myAcct = myAcct – myChex % …matches my withdrawal If myAcct < 0 % transaction failure! urAcct = urAcct – myChex % back out the deposit myAcct = myAcct + myChex – 60 % back out the withdrawal end end Software Reuse • MATLAB is the rapid prototypers’ Wikipedia…! (Every part of your next system simulation already has been implemented by other systems analysts hundreds of times.) • Lab 1 example: – One of MATLAB’s GUI templates already includes two labeled textboxes and two buttons. (You need only one more button, exactly like the others.) – Make a few cosmetic changes, and press the green triangle “GO” button to automatically generate your GUI’s code and earn a 90%. Put It All Together • Integrate all of your lightly-adapted MATLAB stock functions to achieve the customer’s desired performance, in a way that also informs the software designer. • Lab 1 example—insert function invocations directly into the GUI code to earn a 95%: – – – – – – % “100” button paragraph: myAcct = 100 urAcct = 0 % “20” button paragraph: [ myAcct urAcct ] = banksvr( 20 ) Etc. Make the Customer Smile • Clean up the GUI, clarify the Command Window test report, fully test the function(s), etc. (See MATLAB’s extensive library of very professional demonstrations on your computer and at www.Mathworks.com .) • Ensure that every known requirement is demonstrated. • Lab 1 example, which earns 100%: – Transactions’ classic ACID features are clear here. – You and I perceive this collection of independent computers (i.e., the distributed system of two GUI clients and bank server) as a single coherent system. – Several distributed system transparencies are clearly apparent. Summary Take these 5 steps in your next rapid prototyping effort: 0. (Doing absolutely nothing earns 70% by default.) 1. A MATLAB script that simply uses fprintf instructions to print a demonstration of the prototype's required performance in the Command Window earns ~80%. 2. Also allocating those fprintf statements to a collection of interacting functions helps out your software developers and earns ~85%. 3. Also integrating those functions with any necessary MATLAB functions earns ~90%. 4. Also tidying up your code and making its nontechnical customer demonstration abundantly clear earns ~95%. 5. Also making the demo clearly describe the textbook concepts, for which the lab was created, earns ~100%.