In my opinion, testing can be done locally on development computer
With more powerful workstations and advancements in virtualization and containerization technology, more testing can be done locally on a development computer. However, there is still plenty of testing that can't be done in this type of environment.
Regarding technical testing, performance and load testing come to mind as something that can't be done locally for many applications. Although local testing and simulation may highlight potential performance bottlenecks, testing at the scale of production systems often needs to be done in dedicated environments.
Usability and user acceptance testing are also difficult in a local development computer. Again, some testing, especially usability testing, could be done locally or using tools that scan against usability standards. However, making the software available on the devices where end users interact can make usability and user acceptance testing more robust.
These types of testing aren't generally done within a CI/CD pipeline. However, a CI/CD pipeline can make it easier to carry out these tests by executing various levels of automated tests and, when those tests pass, packaging and deploying the software to environments where performance and load testing can be done. The build servers used to execute CI/CD pipelines can also be used to manage any automated performance and load testing.
testing cannot replace manual code review, a lot of security features are not easily tested using automated scripts, there are lots of code paths whose functional correctness need to be examined, not to mention the many possible edge cases (speaking as a full-stack developer looking at back-end codes) (small addition) - these needs human review in addition to testing (in some case, test cases also need reviews). The essence of this point is to express my doubt on any exaggeration of benefit offered by CI/CD over security;
Testing and code review serve very different purposes. Previously, I've written about the purpose of a code review. Although some organizations do use code reviews to find errors and defects, I don't think this is something that humans should be spending their time on. Developing a shared understanding of the system, cross-training, and ensuring the readability and maintainability of the code are far better focuses for the time people invest in code reviews.
It is possible to inject security testing into code reviews. If you have a CI/CD build pipeline, you can and should integrate linters and static analysis tools into the pipeline and expose those results to code reviewers. When humans are carrying out code reviews, they can review the results of these static analysis tools and flag any high priority items for resolution as part of the review process.
I also think it's a mistake to believe that security features can't be easily tested. Many of the items on the Common Weakness Enumeration (CWE) can indeed be found by testing. Others can be found by static analysis. Both testing and static analysis can be incorporated into a CI/CD pipeline. Similar to testing, a CI/CD pipeline can also make it easier to integrate dynamic analysis into a development process by making it easier to build, package, and deploy software to an environment where dynamic scanning tools can be used.
the whole concept of CI/CD seem to be advertised towards managers and other non-coders, and generally for projects that aren't security-critical.
I don't agree with this at all. The foundational work on CI/CD, whether it's the work from Kent Beck's Extreme Progamming (book) or Dave Farley's Continuous Delivery (YouTube, book) or Paul Duvall's Continuous Integration (book) are geared toward practitioners. Dave Farley has also talked about the application of CI/CD on critical projects, such as his past work in the highly regulated finance space.
This isn't to say that it's not important to sell it to managers. It is. The investment needed to set up and maintain a robust CI/CD pipeline is not trivial, and there is plenty of business value. However, there are also huge implications for developers when it comes to rapid feedback and a great confidence in the ability to build and deploy working software quickly and efficiently.
So with all those said, what's the true benefit, application and non-applications of CI/CD?
A few examples:
- Rapid feedback. A CI/CD pipeline is built on fast feedback through automated tests. Having a controlled pipeline that integrates these automated checks with other types of checks and gives developers feedback regarding potential issues on the order of minutes is invaluable.
- Confidence in build and deployment. CI/CD pipelines are controlled and automated. Any configuration and scripts used are managed and controlled carefully to ensure that each pipeline run is correct. The automation ensures that it happens the same way each time, regardless of the developers doing the work that causes the pipeline to be executed.
- A foundation for longer-running tests. Although rapid feedback is key, not all testing and checks can be done quickly. The ability to automate deployment and run these longer-running tests more frequently reduces the overall feedback loops, giving the developers the information they need to make informed decisions about their work.