SPD 2.31 Testing and Architecture

Course Description

This course focuses on advanced topics such as debugging, unit testing, refactoring and design patterns. Students apply these concepts to existing portfolio projects to improve code qualities such as readibility, modularity and extensibility. Topics covered include: debugging techniques, unit-testing, refactoring techniques, design patterns and navigating massive codebases. By the end of the course, students have practical knowledge of writing python unit tests, refactoring legacy code and implementing some desing patterns.

Prerequisites

  • CS 1.0 - INTRODUCTION TO PROGRAMMING
  • CS 1.1 - OBJECT ORIENTED PROGRAMMING

Course Specifics

Course Delivery: hybrid | 7 weeks | 14 sessions

Course Credits: 3 units | 37.5 Seat Hours | 75 Total Hours

Learning Outcomes

Students by the end of the course will be able to ...

  1. Compare and contrast software architecture options and design patterns to make informed decisions around which to pick.
  2. Produce elegant pseudocode to quickly describe how to solve a problem.
  3. Practice techniques to improve the quality and craftsmanship of their software.
  4. Design and implement code refactoring techniques to improve readability.
  5. Apply debugging and unit-testing best practices to improve quality assurance.

Schedule

Course Dates: Thu, Jan 21 – Thu, March 4, 2021 (7 weeks)
Class Times: Tue and Thu at 9:30am –12:15pm (13 class sessions)

Class Date Topics
1 Thu, Jan 21 Debugging Steps
2 Tue, Jan 26 Debugging Techniques
3 Thu, Jan 28 Using a Debugger
4 Tue, Feb 2 Refactoring - PEP 8
5 Thu, Feb 4 Refactoring - Composing Methods
6 Tue, Feb 9 Refactoring - Composing Methods 2
7 Tue, Feb 11 Refactoring - Simplifying Conditional Expressions
8 Tue, Feb 16 Refactoring - Other Refactoring Techniques
9 Thu, Feb 18 Refactoring - Lab
10 Tue, Feb 23 Unit Testing 1
11 Thu, Feb 25 Unit Testing 2
12 Tue, March 2 Architecture - Design Patterns 1
13 Thu, March 4 Architecture - Design Patterns 2

Assignment Schedule

We will be using Gradescope, which allows us to provide fast and accurate feedback on your work. All assigned work will be submitted through Gradescope, and assignment and exam grades will be returned through Gradescope.

As soon as grades are posted, you will be notified immediately so that you can log in and see your feedback. You may also submit regrade requests if you feel we have made a mistake.

Your Gradescope login is your Make School email, and your password can be changed at https://gradescope.com/reset_password. The same link can be used if you need to set your password for the first time.

The assingments cover debugging, refactoring, unit testing and architecture topics. The following is the list of assignment titles:

  1. Debugging: Gathering info and writing assumptions
  2. Refactoring - PEP 8: Improving Code Readibility Using PEP 8. The assingments cover indentation, whitespaces, naming convention and docstrings.
  3. Refactoring - Composing Methods. The assignments cover various techniques including extract method, replace temp with query, introducing explaining variable, split temp variable and 'remove assingment to method parameters'.
  4. Refactoring - Moving Features and Organizing Data. The assingments include techniques such as extract class, Replace Magic numbers with constants.
  5. Refactoring - Simplifying Conditional Expressions. The assingments include techniques such as decompose conditional, consolidate conditionals, consolidate duplicates, remove control flags and Replace Nested Conditional with Guard Clauses.
  6. Refactoring - Other techniques. The assignment includes extract superclass technique.
  7. Unit Test 1 and Unit Test 2. The assingments include writing unit tests for a tic-toc-toe program.
  8. Architecture 1 and 2. The assingments include refactoring a program to use the observer pattern and finite state machine pattern.

Please refer to sample-exercises.md for details. For assingments due dates please refer to Gradescope. As a rule of thumb, the due date of an assignment is one to two weeks after its corresponding lesson is taught.

Evaluation

To pass this course you must meet the following requirements:

  • Obtain at least 70% cumulative score on the assignments.
  • Pass the final summative assessment (minimum grade 70%).
  • Actively participate in class and abide by the attendance policy.
  • If an assignment is not passing, you have 1 week to make any necessary fixes and resubmit for full points.

Information Resources

  1. "Refactoring: Improving the Design of Existing Code" (1st edition) by Martin Fowler.
  2. "Effective Python: 90 Specific Ways to Write Better Python" (2nd edition) by Brett Slatkin.
  3. PEP 8 -- Style Guide for Python Code
  4. "Debugging: The 9 Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems" by David J Agans

Any additional resources you may need (online books, etc.) can be found here. You can also find additional resources through the library linked below:

Make School Course Policies