跳转至

Why do we need tests

While writing tests requires initial investment, it provides significant long-term benefits:

  • Early bug detection is much cheaper than fixing issues in production.
    • We prefer to find bugs in our local environment by Unit tests, not in production.
  • Reduces debugging and maintenance time
  • Speeds up development by catching issues early
    • Some nits can be easily detected by Unit tests.
  • Minimizes regression testing effort

Formal Process for Project Development

You can take Project 2 in CS161 as an example.

The stages below are suitable for any project development. These are abstract ideas and you need to customize them to your project.

Plan Phase

A good start is to write a file in this stage.

The initial phase focuses on understanding and documenting project needs:

  • Gathering business requirements and stakeholder input
  • Defining project scope and objectives
Plan Phase

Get the requirements and make a plan with global view.

Design Phase

A good start is to write a file in this stage.

After requirements are established, the project moves to architectural planning:

  • Creating system architecture
  • Establishing technical specifications
  • Defining software components and modules
  • Planning integration points
Design Phase

Attach great importance to modularity and hierarchy.

  • Function Encapsulation
  • Function Abstraction
  • Modularity
  • Hierarchy / Architecture

Test-writing Phase

You should make comprehensive testing ensures quality:

  • Unit testing individual components
    • nearly 100% coverage.
    • ex: you can make a test for every important function.
  • Integration testing between modules
    • consider calling between different modules.
  • System testing of the complete application
    • after unit tests for every component, you should test the whole system.
  • User acceptance testing
    • test the system with the user's perspective.
  • Performance and security testing
    • test performance and security of the whole system.
Test Writing

You should spare no effort to make tests as comprehensive as possible!!!

You should attach great importance to test writing, so that you can check code-based nits as much as possible in early stage.

Development Phase

This part mainly focuses on actual implementation:

  • Modularity
  • Writing code according to design specifications
  • Standards and lint
  • Implementing features iteratively

Testing Phase

You should use your own tests above to test the software.

Therefore, you should attach great importance to test writing, so that you can check code-based nits as much as possible in early stage.

If you meet some errors in testing, you should go back to the development phase to fix the bugs.

Deployment Phase

Moving the software to production involves:

  • Packaging the application
  • Configuring production environments
  • Installing and implementing the system
  • Conducting beta testing

Maintenance Phase

Ongoing support includes:

  • Monitoring system performance
  • Fixing bugs and issues
  • Implementing updates and improvements
  • Providing user support
  • Managing system changes
How to be a responsible maintainer

The easiest way to be a responsible maintainer is to make you project a open-source.

And developers around the world will test, make issues, pull requests in your project.

You can learn a lot from them. And make the project better and better.