Download - [Mas 500] Software Development Strategies
![Page 1: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/1.jpg)
MAS.500 - Software Module - Rahul Bhargava
Software Dev Strategies
2014.11.12
![Page 2: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/2.jpg)
Data StructuresTesting
Managing ComplexitySource Code Management
LicencesAlgorithms
![Page 3: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/3.jpg)
Data Structures
![Page 4: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/4.jpg)
❖ Array
❖ HashMap/Dictionary/AssociativeArray
❖ List
❖ Queue (FIFO)
❖ Stack (LIFO)
❖ Tree (parent/children)
❖ Graph (node/vertex)
![Page 5: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/5.jpg)
Testing
![Page 6: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/6.jpg)
Approaches
❖ Motivations
❖ Make sure individual pieces of your project work, before sticking them together
❖ Ensure changes in one part of system haven’t broken another part by mistake
❖ Strategies
❖ Unit Testing, Functional Testing, Integration Testing
❖ Technologies
❖ xUnit (ie. jUnit for Java, pyUnit for Python, Test::Unit for Ruby, etc)
![Page 7: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/7.jpg)
Unit Test Anatomy
❖ Load up some test data
❖ Run some piece of your code on your test data
❖ Verify the result is correct
❖ Remember to test the multiple valid paths through your piece of code, not just the most likely one (ie. test edge cases too)
❖ demo
![Page 8: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/8.jpg)
Strategies
❖ Test Driven Development
❖ Write your tests before your code?
❖ Continuous Integration
❖ Automated build/test cycle, all day long
❖ Pair Programming
❖ Two heads are smarter than one?
❖ 80/20
❖ Write tests for the most critical low-level parts of your system
![Page 9: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/9.jpg)
Managing Complexity
![Page 10: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/10.jpg)
It’s Easy to Remember Less
❖ Abstraction
❖ Higher level commands are easier to use
❖ Simplifying assumptions
❖ Convention makes things easier to guess
❖ Readability
❖ Remember WTF something does 6 months later
❖ Commenting
❖ Focus on the why, not the what
![Page 11: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/11.jpg)
Reminders
❖ “Refactor” Constantly
❖ Change how your code does what it does to reflect things you learn
❖ Keep the “Technical Debt” (video) approach in mind
❖ Text Editors, Integrated Development Environments (IDEs)
❖ Can help, or hurt, your code process
❖ Some Examples: PyDev, Eclipse, Xcode, Visual Studio, Mono Develop, Aptana Studio
❖ IDE demos
![Page 12: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/12.jpg)
Source Code Management
![Page 13: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/13.jpg)
SCM
❖ Motivations: cover-your-rear, collaborate on code, control deployment
❖ Technologies: CVS (old school), SVN (centralized), git (distributed)
Server
Sally Bob
code changes code changes
![Page 14: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/14.jpg)
SCM: Processgit (with a server)
• Clone repository to your computer (only once)
• Change code• Commit changes locally• Pull changes from server• Merge any conflicts• Commit fixes locally• Push all commits back to server
Learn More:
git-scm.com/book/en/Getting-Started-Git-Basics
SVN• Checkout code to your computer (only once) • Change code• Update code to get any changes from the
server• Merge conflicts• Commit changes back to server
Learn More:http://svnbook.red-bean.com/en/1.6/svn.basic.in-action.html
…lets not relive the dark days of CVS…
![Page 15: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/15.jpg)
SCM: Example
❖ Setup
❖ With git you usually have to set up SSH keys first for authentication
❖ Clone the project to get the repository from the server to your computer
❖ git clone [email protected]:username/project.git
❖ Process
❖ Make your changes (for example, edit README.txt)
❖ Stage the changes that you want to commit
❖ git add README.txt
❖ Commit the changes
❖ git commit –m “Better instructions”
❖ Push the changes to the main branch (master) on the server (origin)
❖ git push origin master
![Page 16: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/16.jpg)
DEMO
![Page 17: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/17.jpg)
Handling Conflicts
❖ Structuring your source files well helps avoid conflicts
❖ Using MVC can help (see later slides)
❖ Uh oh, we both changed same part of the README.txt!
❖ When if happens, open the file and find the conflict:
❖ <<<<<<<< HEAD:README.txt
❖ My code here
❖ =================
❖ Other person’s new code here
❖ >>>>>>>>>>> [their_version]:README.txt
❖ Pick which version to keep and delete the other stuff
❖ Read more in the gitbook
❖ git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging#Basic-Merge-Conflicts
![Page 18: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/18.jpg)
SCM: Tags and Branches
❖ Tags - take a snapshot of your repository at a certain point in time
❖ Useful for deploying specific snapshots of code that you know work to a server/demo-box
❖ Branches – work on side projects without affecting your main development
❖ git makes merging branches easier, but should still be done carefully
![Page 19: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/19.jpg)
SCM: Repo Hosting❖ Necsys can host repositories
❖ http://wiki.media.mit.edu/view/Necsys/MediaLabGITServer
❖ http://www.github.com
❖ public, social, issue tracking, project maps 1-to-1 onto repository
❖ mit has an enterprise site license (http://github.mit.edu/)
❖ http://gitorious.com
❖ Open source, organized by projects with multiple repositories
❖ http://code.google.com
❖ http://sourceforge.net
![Page 20: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/20.jpg)
SCM: Desktop Tools
❖ command line
❖ Tortoise for Windows:
❖ http://tortoisesvn.net
❖ http://code.google.com/p/tortoisegit/
❖ GitHub for Mac
❖ http://mac.github.com
❖ GitBox for Mac
❖ http://www.gitboxapp.comh
❖ Eclipse
![Page 21: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/21.jpg)
SCM: GitHub
❖ online hosting
❖ ssh keys
![Page 22: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/22.jpg)
Licences
![Page 23: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/23.jpg)
http://marakana.com/s/post/1030/understanding_open_source_licenses
![Page 24: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/24.jpg)
http://www.shafqatahmed.com/2008/10/comparison-of-d.html
![Page 25: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/25.jpg)
Algorithms
![Page 26: [Mas 500] Software Development Strategies](https://reader035.vdocument.in/reader035/viewer/2022081602/554a5613b4c905522f8b4c20/html5/thumbnails/26.jpg)
❖ Measured based on efficiency (good examples)
❖ Fixed time: O(1) - Fast!
❖ Pull the 10th value out of an array
❖ Log time - O(log n) - Scales well!
❖ Find a number in a sorted array via binary search
❖ Linear time: O(n) - Does ok!
❖ Sum an array of numbers
❖ Exponential time: O(2n) - Scales poorly!
❖ Graph traversal stuff