MAS.500 - Software Module - Rahul Bhargava 
Software Dev 
Strategies 
2014.11.12
Data Structures 
Testing 
Managing Complexity 
Source Code Management 
Licences 
Algorithms
Data Structures
❖ Array 
❖ HashMap/Dictionary/AssociativeArray 
❖ List 
❖ Queue (FIFO) 
❖ Stack (LIFO) 
❖ Tree (parent/children) 
❖ Graph ...
Testing
Approaches 
❖ Motivations 
❖ Make sure individual pieces of your project work, before sticking 
them together 
❖ Ensure ch...
Unit Test Anatomy 
❖ Load up some test data 
❖ Run some piece of your code on your test data 
❖ Verify the result is corre...
Strategies 
❖ Test Driven Development 
❖ Write your tests before your code? 
❖ Continuous Integration 
❖ Automated build/t...
Managing Complexity
It’s Easy to Remember Less 
❖ Abstraction 
❖ Higher level commands are easier to use 
❖ Simplifying assumptions 
❖ Convent...
Reminders 
❖ “Refactor” Constantly 
❖ Change how your code does what it does to reflect things you learn 
❖ Keep the “Tech...
Source Code Management
SCM 
❖ Motivations: cover-your-rear, collaborate on code, 
control deployment 
❖ Technologies: CVS (old school), SVN (cent...
SCM: Process 
git (with a server) 
• Clone repository to your computer (only 
once) 
• Change code 
• Commit changes local...
SCM: Example 
❖ Setup 
❖ With git you usually have to set up SSH keys first for authentication 
❖ Clone the project to get...
DEMO
Handling Conflicts 
❖ Structuring your source files well helps avoid conflicts 
❖ Using MVC can help (see later slides) 
❖...
SCM: Tags and Branches 
❖ Tags - take a snapshot of your repository at a certain 
point in time 
❖ Useful for deploying sp...
SCM: Repo Hosting 
❖ Necsys can host repositories 
❖ http://wiki.media.mit.edu/view/Necsys/MediaLabGITServer 
❖ http://www...
SCM: Desktop Tools 
❖ command line 
❖ Tortoise for Windows: 
❖ http://tortoisesvn.net 
❖ http://code.google.com/p/tortoise...
SCM: GitHub 
❖ online hosting 
❖ ssh keys
Licences
http://marakana.com/s/post/1030/understanding_open_source_licenses
http://www.shafqatahmed.com/2008/10/comparison-of-d.html
Algorithms
❖ Measured based on efficiency (good examples) 
❖ Fixed time: O(1) - Fast! 
❖ Pull the 10th value out of an array 
❖ Log t...
Homework 
❖ see course outline: bit.ly/mas500f14
Upcoming SlideShare
Loading in …5
×

[Mas 500] Software Development Strategies

918 views

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
918
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

[Mas 500] Software Development Strategies

  1. 1. MAS.500 - Software Module - Rahul Bhargava Software Dev Strategies 2014.11.12
  2. 2. Data Structures Testing Managing Complexity Source Code Management Licences Algorithms
  3. 3. Data Structures
  4. 4. ❖ Array ❖ HashMap/Dictionary/AssociativeArray ❖ List ❖ Queue (FIFO) ❖ Stack (LIFO) ❖ Tree (parent/children) ❖ Graph (node/vertex)
  5. 5. Testing
  6. 6. 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)
  7. 7. 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
  8. 8. 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
  9. 9. Managing Complexity
  10. 10. 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
  11. 11. 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
  12. 12. Source Code Management
  13. 13. SCM ❖ Motivations: cover-your-rear, collaborate on code, control deployment ❖ Technologies: CVS (old school), SVN (centralized), git (distributed) Server Sally Bob
  14. 14. SCM: Process git (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…
  15. 15. 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 git@github.com: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
  16. 16. DEMO
  17. 17. 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
  18. 18. 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
  19. 19. 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
  20. 20. 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
  21. 21. SCM: GitHub ❖ online hosting ❖ ssh keys
  22. 22. Licences
  23. 23. http://marakana.com/s/post/1030/understanding_open_source_licenses
  24. 24. http://www.shafqatahmed.com/2008/10/comparison-of-d.html
  25. 25. Algorithms
  26. 26. ❖ 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
  27. 27. Homework ❖ see course outline: bit.ly/mas500f14

×