| |
What is Production Code?
http://www.perlmonks.org/?node_id=615233
What is Production Code?
The terms "production code" and "software deployment" are used with varying shades of meaning and rigour.
It should be clear that "production code" is code that's actually in production and has live end-users and is making revenue, cash-flow for the owners most of times.
"Production quality code" is code that's ready for a production environment. "Production quality code" may or may not actually be in production at the moment, but it's of a quality that it could safely be in production. "Production code" is what's currently deployed in production and handling live users and their data. It may or may not be ready for production, and it may not even safely handle data.
Ideally, no code becomes "production code" until it is also "production quality code". Unfortunately, we don't live in an ideal world and sometimes code that's not "production quality code" indeed becomes "production code".
For code to be considered "production quality", I reckon that the following details must be considered: (BTW: This is by no means an exhaustive list!)
Design * Design documents are readily available and organized for easy access * All functionality is specified to an appropriate amount of detail * Presentation, Business Logic, and Data have been abstracted (ie. Three tier architecture) * Code is well-documented such that it explains all functionality and facilitates maintenance * An effective test strategy/plan exists
Implementation * The application does what it was intended to do * Modules pass unit tests * Log messages provide accurate portrayal of runtime and facilitate debugging * Errors have been handled effectively * Configuration variables have been abstracted into a sane configuration scheme * Code meets the benchmark criteria * Resource utilization is sane * Test plan has been executed and application has been accepted
Deployment * Code/documentation has undergone peer review * peer review coordination (ie. "one-hand knows what the other is doing") * A rollback plan exists * Deployment recipe exists
With that said, I present the following questions to elicit the collective monk response: a. What characteristics does production quality code possess? b. If there were a checklist that could be applied to determine when software is ready to deploy, what would be on this checklist? c. What are the characteristics of good deployment?
Don't deploy good software on bad machines or machines cluttered with software you can't control.
I assume that a production-level code must have the following characteristics: 1) The production software can perform at the necessary workload without disruption or degradation of the service. Scalability: Handling extra load should not require re-writing the software 2) Software has been successfully tested in different production scenarios and the testing or QA of code has surpassed a rigorous "user acceptance testing" 3) Transforming working prototype into production software which runs on fail-safe redundant architecture that can work in real business, i.e. production environment, needs time, code refactoring, and attention to details 4) The production code has acceptable level of maintainability and is reasonably well commented. The production software has Documentation manual which explains functionality, all features and facilitates maintenance. Also to consider that a well formatted and documented code helps maintainability of code base. 5) Production software does not necessarily mean reliable mission critical software 6) If the production software is an international service or application, it must be localized 7) Production code is used by end-users, often customers under conditions described in Terms-of-Service Agreement 8) The software does well, what it was intended to do 9) Log files provide an accurate description of run-time performance and software reliability metrics and reporting which do facilitate debugging and software maintainability 10) Many user cases and scenarios may occur in production that the have been not predicted during development. 11) Exception handling is one of the most important characteristic of production quality code. Software must be able to handle an exceptional scenario in clear and predefined fashion. The software should never crashed due to bad input data or undesired operational scenario. Log files must provide an accurate description of bad input data and clear reporting 11) Recoverable operations, Fault tolerance: ability to survive uncaught exceptions. Code should be able to recover itself in the case of crash. 12) Recoverable data, software should be able to recover its data in the case of data loss or data corruption. Data redundancy: software should never lose user and operations data
|
|