Class Note for CMPSCI 220 at UMass(19)
Class Note for CMPSCI 220 at UMass(19)
Popular in Course
Popular in Department
This 6 page Class Notes was uploaded by an elite notetaker on Friday February 6, 2015. The Class Notes belongs to a course at University of Massachusetts taught by a professor in Fall. Since its upload, it has received 15 views.
Reviews for Class Note for CMPSCI 220 at UMass(19)
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 02/06/15
Highly Skilled Programming CMPSCI 220 291A I Pro cient with Programming Methodology I Tools Spring 2009 I Methods I The two are often interrelated I Eg design methods and programming language I Specifically 00 language features and design 15 Te sting and XI eXtrerne Programming Unwinslnnr Human Amman Dwa nuilnlnnvulu x 1 mmquot nrmnssnmuins Am Dwa nuilnlnnwlu x Tools and Methods The Bigger Picture I Thus far we ve focused on I Xhat makes code goodbetter I Tools I Are there dimensions of code quality I java amp Effectivejava usage guidelines I Can we measure code qualitygt 39 EChPSe I Xhich tactics demgn patterns or others lead to I Subversion improvements on which dimensionsgt I Methods I Xhat strate 39des choice use of tactics gY gm I Design patterns and design principles I How do we decide what code to Wntegt I Tactical approaches to goodbetter code I HOW do we go about mmg Unwinslnnr Human Amman Dwa nuilnlnnvulu x i mmquot nrmnssnmuins Am Dwa nuilnlnnv u x Code Quality Code Quality The Design Dimension I One dimension focuses on overall system I Three standard faces function I Simplicity Reliability Modularity I Efficiency I Information hiding I Mamtzmablhty I Toward measuring and achieving these I USablhtY I Simplicity Measure and reduce complexity I These and similar referred to as ilities I Modularity Measure and reduce coupling I anarily relevant to prograrnmingeinetheelarge I Modularity Measure and increase cohesion Unwinslnnr Human Amman Dwa nuilnlnnvulu x r A H mmquot nrmnssnmuins Am Dwamuilnlnnu u x Where39s the Strategy Software Design Methodologies I Design principles and patterns are good tactics I Many methodologies have been proposed I Motivated by code quality goals I We summarized four representative examples I But what strategy guides their application 39 Code and Ex I Waterfall I Unified Process I How do we decide what code to wntegt I How do we go about Wntingitgt I When and how do we apply demgn principles I exueme Pregmmmmg KP and patternSP I Today we look at XP in more detail I Refacto is one answer to last question I XP can be seen as a reaction against Waterfall I Software demgn methodologies address all Just one example of many possible W chosen as a contrast Uulvnslnnr lulnssunusins Amrm Dwamu nlnnvulu qul Ullvnsln nrmnssnmuins Alvin Dwa nuilnlnnwlu Xllulle Waterfall Waterfall I Development proceeds in a cascade of steps I Attributes Requirements analysis Each step completed before nextbegins Speci cation No backtracking m strict version Detailed design Each step produces an artifact document etc I Code and unit test I Integm on 811d System test I Emphasis on getting freezing requirements I Installation I Based on construction engineering approaches I Maintenance I Problematic when applied to software Uulvnslnnr lulnssunusins Amrm Dwannu nlnnvulu qul Ullvnsln nrmnssnmuins Andrus Dwa nuilnlnnwlu Xllulle eXtreme Programming An XP Champion Kent Beck I Very codercentiic like code and fix I Describes XP as a I But imposes much more discipline I lightweight I Pair programming I efficient I Continuous refactonng I lowfisk I Unit tests wntten before code untested code I exible does not exist testingis heavily automated I Only build what is needed try not to anticipate I Pmdlcmble future extenmons no borrowmg trouble I SCienti C I Some evidence Applicable for small projects I and fun Way to develop software Uulvnslnnr lulnssunusins Amrm Dwamu nlnnvulu qul A Ullvnsln nrmnssnmuins Alvin Dwamuilnlnnwlu Xllulle An XP Champion Ron Jeffries Thirteen Practices of XP I Describes XP as a discipline of software I Xhole team development based on values of chem as a team member 39 Smphmtya I Other team members rotate through roles I communication I feedback and I courage I Metaphor I Everyone on team uses common terminology I Improves communication across domains I Team comes together around simple practiCES Supports conceptual integrity of system I feedback allows them to see where they are l practices can be tuned in their unique situation Unwinslnnr lulnssanmsins Amman Dwamuilnlnnvulu m L Ullvnsm nrmnssnmuins Mm Dwannuilnlnnwlu Xusz Thirteen Practices of XP Thirteen Practices of XP I Planning game I Simple design I Focuses on next step of development I System design always as simple as current level I Clients express goals through user Stories Of fUIlCUODZJlfy SHOWS I Team estimates costs based on stories I No extraneous detail needed 0r allowed I Chem Pnonuzes stones to direct P1015 I Design only encompasses next iteration s added I After delivery team evaluates estimates to features improve in next round I Cumbersome or unwieldy code gt refactor mum lulnssanmxins Mm Dwamuilnlnnvulu m r Ullvnsm nrmnssnmuins Anvil Dwamuilnlnnwlu Xusz Thirteen Practices of XP Thirteen Practices of XP I Small releases I Pair programming Tested working code released frequently All code developed by programmers working in I Each development cycle gives client new version P3115 I Client s evaluation dictates next iteration 39 TWO Programmers and one mmPUteI I Client tests I One person at keyboard wntes code I Other supports in whatever way currently I Client develops automated acceptance tests appropriate checking delivered software against user stories I Used by team to determine if current user story 39 May thh at 2115 mm completed mum lulnssanmxins Mm Dwamuilnlnnvulu me A r Ullvnsm nrmnssnmuins Anions Dwamuilnlnnwlu Xusz Thirteen Practices of XP I Testedriven development I After establishing next miniegoal developers wnte an automated test before coding I Test must verify miniegoal satisfaction I Becomes part of everegrowing test suite that is run constantly providing feedback I Design improvement formerly refactoring I As teai39n notices demgn de ciencies it refactors I By induction simple design followed by small improvements yields code with good demgn qualities ursn lilnssanmxins Aimris Dwamuilnlnnvulu s Thirteen Practices of XP I Sustainable pace formerly 40 hour week I Teai39n should put same amount ofwork and effort into each iteration I Overtime leads to burnout mistakes overtime I Coding standards I Developed code should have a conmstent style I Particular standard used is less important than adhering to one consistent standard ursn lilnssanmxins Aimris Dwamuilnlnnvulu s Thirteen Practices of XP I Collective code ownership Team as awhole owns system software I Original coder ofany piece irrelevant Anyone can modify any code at any time I Has been called egoeless programming I Continuous integration At all times and all levels of functionality system compiles runs andpasses all tests When new code is integrated into system resultmust compile run and pass all tests UIIVDEIH uriiissimusuu Ainus Dwamuilnlnnwlu Xllmm Pair Programming I Two people working together at one keyboard I Driver ee currently controls keyboard amp mouse I Coepilot ee various supporting roles navigator monitor of details alternate driver I Driver and coepilot may swap at any time I Based on situation communication I A rule If someone asks you to pair with them and you can then you must say yes ursn lilnssanmxins Aimris Dwamuilnlnnvulu s Another XP Practice Spikes I Spike a short exploration of a problem area I Needed when an issue arises duringiteration I Response is to drive a spike I lnvolves a throweaway side excurmon I Result is not intended to be integrated into system UIIVDEIH uriiissimusuu Ainus Dwamuilnlnnwlu Xllmm Bene ts of Pair Programming I RealeTime Code Reviews I Driver concentrates on producing code I Coepilot focuses on catching mistakes such as typos cognitive dropouts invalid assumptions I Avoiding distractions I Shared responsibility increases attention I Scheduled shared work time enforces discipline UIIVDEIH uriiissimusuu Ainus Dwamuilnlnnwlu Xllmm Benefits of Pair Programming Practicalit39es of Pair Programming I Managing for two I Working as a pair Two people agreeing on how to approach a Shared responsibility and credit problem increases confidence in correctness I Groups of Palts I Disagreement forces discussion I Ideally Whole temm one mom I But since all XP steps are small and reversible I Pairs overheann interactin with one another discussions should be short decisions made g g I Odd numbers I Too few discussions or too many missed errors gt too comfortable 3 PEI gt Charge Falling I Rotating tno two pair third does something else then swaps in for one of the pair etc I Knowledge migration I Two COrPJlOtS Unwinslnnr lulnssanmsins Amman Dwamuilnlnnvulu m r 1 name nrmnssnmuins AM Dwa nuilnlnnv u Xusz Practicali 39es of Pair Programming TestDriven Development I Giving up the wheel I Xhy test before coding I Reading each other s signals I ProVides a target for coding I When should dnver relinquishgt I Forces smphmty I When should COrPJlOt askgt I Clari es the task at hwd I Changing pairings lnl ubltS onitheifly editing I Effective pairings tend to repeat I Makes refactonng POSSIblI I But avoid exclusive pairing Uulvnslnnr lulnssaomxnls Mm Dwamuilnlnnvulu m r i Ullvnsln nrl nssnmuins Mm Dwamuilnlnnv u Xusz The Virtue of Simplicity TestDriven Development I Test case should be stated as completely as I How to test before coding POSSlble I First decide on next subtask to accomplish I Find enough representative tests to cover task I Write a test case that Wm Show the subtzsk has I Given test case only coding goal is to pass been completed successfully teStS I Won t compile or run until subtask code exists I Should be done in simplest possible way I Gmded by test case code the subtask I Ugly code will be improved later by refactonng I Automated test case support I g JUmtgt helps I XP credo small steps refactoring yields I I I Modularity loose coupling high cohesion Uulvnslnnr lulnssaomxnls Mm Dwamuilnlnnvulu m z A r Ullvnsln nrl nssnmuins Mm Dwamuilnlnnwlu Xusz TestDriven Development TestDriven Development I Consider a simple example I Passing the test Subtask nd the largest of three given Integers public int maxOfThreelntsint n1 int n2int n3 I Test case I Xhat code might be appropriate if maXO hreelmsmjs H I Xhat ifit s too simple Systemoutprintln Passed Test I How about more exhaustive testing else i I Developing and maintaining a test suite Systemoutprintln Failed Test I To be continued jUnit tomorrow Unwinslnnr lulnssaomsins Amt Dwamuilnlnnvulu meme 39 Ullvnsln nrmnssnmuins Anvil Dwa nuilnlnnwlu meme Kinds of Tes ds of Testing 39 Unit fess I Unit testing our primary focus Test aparticular umte1ass method Comes st I Need to work in isolation I Easiest to automate May need to mock up othetpatts of system we will talk about EasyMoeie one tool to help that I Integmhon 555mg I Thorough unit testing in an 00 language goes a long way I jUnit a typical example of support tools Collections ofunits subsystems System testing Xhole system Unwinslnnr lulnssaomsins Amt Dwamuilnlnnvulu meme Ullvnsln nrmnssnmuins Anvil Dwannuilnl mv u meme Kinds of Testing I Black Box testing Don t assume knowledge of how code works Develop tests mete tom the speci cation Does not necessarily exercise an code I White Bo tesnng Assume knowledge of code Tties to exercise an code may compute towmgz Coverage 7 m of code that is m at all by test suite Tties to exercise an Pm at as many as possible I XP is more Black Box but does not prohibit White Box Unwinslnnr lulnssaomsins Amt Dwamuilnlnnvulu meme
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'