|
8 | 8 |
|
9 | 9 |
|
10 | 10 |
|
11 | | -***Clean code*** |
| 11 | +***Software Engineering*** |
| 12 | + |
| 13 | +*Over the past two decades, an increasing number of researchers have become involved in computational research. Many of these researchers have never received formal training in software engineering. Software engineering is a discipline in its own and includes the design, implementation, documentation, testing and deployment of software.* |
| 14 | + |
| 15 | +*The lack of good software engineering practices can negatively affect the reliability and transparency of software, and consequently, its transparency and reproducibility. Poorly designed and documented software can be difficult for peers to understand, use, modify, and debug.* |
| 16 | + |
| 17 | +*Additionally, inadequate software engineering practices can lead to a situation where there is no way to verify if the code used to generate computational results is functioning as the researcher intends.* |
| 18 | + |
| 19 | +*It is important to recognize that there is a vast field dedicated to software engineering, encompassing a wide range of tools and best practices that can be utilized to enhance software development.* |
| 20 | + |
| 21 | +*Below we very briefly provide a few pointers to improve your software engineering practices.* |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +***Coding*** |
| 26 | + |
| 27 | +*Following best practices for scripting, functional programming, or objective-oriented programming may significantly improve the quality of the code but requires training and experience.* |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +*<u>Clean code</u>* |
12 | 32 |
|
13 | 33 | *Write programs for people, not computers (code should be easily read and understood). Adopting clean code practices helps to standardize and organize software code in order to enhance readability. This allows developers to concentrate on core functionality and reduce errors.* *Readability helps reproducibility and transparency*. |
14 | 34 |
|
|
28 | 48 |
|
29 | 49 |
|
30 | 50 |
|
31 | | -***Code testing*** |
32 | | - |
33 | | -*Interrogate specific and isolated coding behaviour to reduce coding errors and ensure intended functionality, especially as code increases in complexity. Describe if software tests have been performed and how to re-run these tests.* |
34 | | - |
35 | | - |
36 | | - |
37 | | -***Integrated development environment** (IDE)* |
| 51 | +**Code versioning** |
38 | 52 |
|
39 | | -*Consider using an IDE, e.g., PyCharm and DataSpell from JetBrains (https://www.jetbrains.com/), RStudio (https://www.rstudio.com/)* |
| 53 | +*ENCORE is based on Git/GitHub for versioning of code and code documentation. It may be worthwhile to dive into the Git/GitHub world at greater detail. For example:* |
40 | 54 |
|
| 55 | +* *[Understanding the Staging Area](https://www.developernation.net/blog/git-internals-part-3-understanding-the-staging-area-in-git/)* |
| 56 | +* *[Git branching strategies](https://tilburgsciencehub.com/topics/automation/version-control/advanced-git/git-branching-strategies/#:~:text=A%20Git%20branching%20strategy%20allows,set%20of%20advantages%20and%20disadvantages.)* |
| 57 | +* *Perez-Riverol, Y., Gatto, L., Wang, R., Sachsenberg, T., Uszkoreit, J., Leprevost Fda, V., Fufezan, C., Ternent, T., Eglen, S. J., Katz, D. S., Pollard, T. J., Konovalov, A., Flight, R. M., Blin, K., & Vizcaino, J. A. (2016). [Ten Simple Rules for Taking Advantage of Git and GitHub](https://doi.org/10.1371/journal.pcbi.1004947). PLoS Comput Biol, 12(7), e1004947.* |
| 58 | +* *[Comprehensive Guide to Version Control](https://medium.com/@liberatoreanita/mastering-git-a-comprehensive-guide-to-version-control-7624dbb88a94)* |
41 | 59 |
|
42 | 60 |
|
43 | | -***Write comments as you code (not afterwards).** Modern IDEs will often automatically generate documentation strings as you write code, which removes the burden of having to remember to write comments. (e.g., PyCharm, DataSpell).* |
44 | | - |
45 | 61 |
|
| 62 | +***Code testing*** |
46 | 63 |
|
47 | | -***Automated documentation tools*** |
| 64 | +*Interrogate specific and isolated coding behaviour to reduce coding errors and ensure intended functionality, especially as code increases in complexity. Describe if software tests have been performed and how to re-run these tests.* |
48 | 65 |
|
49 | | -*Consider the use of documentation tools to partially automate the generation of documentation. For example, using Python docstrings (https://realpython.com/documenting-python-code/) together with Sphinx https://www.sphinx-doc.or) to automatically generate documentation.* |
| 66 | +*From [IBM](https://www.ibm.com/topics/software-testing): There are many different types of software tests, each with specific objectives and strategies:* |
50 | 67 |
|
| 68 | +- ***Acceptance testing:** Verifying whether the whole system works as intended.* |
| 69 | +- ***Code review:** Confirming that new and modified software is following an organization’s coding standards and adheres to its best practices.* |
| 70 | +- ***Integration testing:** Ensuring that software components or functions operate together.* |
| 71 | +- ***[Unit testing](https://en.wikipedia.org/wiki/Unit_testing):** Validating that each software unit runs as expected. A unit is the smallest testable component of an application.* |
| 72 | +- ***Functional testing:** Checking functions by emulating business scenarios, based on functional requirements.* |
| 73 | +- ***Performance testing:** Testing how the software runs under different workloads. Load testing, for example, is used to evaluate performance under real-life load conditions.* |
| 74 | +- ***Regression testing:** Checking whether new features break or degrade functionality. Sanity testing can be used to verify menus, functions and commands at the surface level, when there is no time for a full regression test.* |
| 75 | +- ***Security testing:** Validating that your software is not open to hackers or other malicious types of vulnerabilities that might be exploited to deny access to your services or cause them to perform incorrectly.* |
| 76 | +- ***Stress testing:** Testing how much strain the system can take before it fails. Stress testing is considered to be a type of non-functional testing.* |
| 77 | +- ***Usability testing:** Validating how well a customer can use a system or web application to complete a task.* |
51 | 78 |
|
| 79 | +*Not all of these tests are equally important when it comes to scientific software.* |
52 | 80 |
|
53 | | -*<u>Instructions</u>:* |
54 | 81 |
|
55 | | -* *Remove all Instructions and the Explanation once you have completed the template.* |
56 | | -* *Level of detail: Information provided should be sufficient for someone who was not involved in the project and/or has limited knowledge about the topic, to understand and reproduce the project.* |
57 | 82 |
|
| 83 | +***Code documentation*** |
58 | 84 |
|
| 85 | +*Write comments as you code (not afterwards). Modern IDEs can assist in to automatically generate documentation strings as you write code, which removes the burden of having to remember to write comments. (e.g., PyCharm, DataSpell from [JetBrains](https://www.jetbrains.com/)).* |
59 | 86 |
|
60 | | -***Software documentation*** |
| 87 | +*Be aware of guidelines and tools to (automatically) generate documentation such as [Sphinx](https://www.sphinx-doc.org) using Python [docstrings](https://www.geeksforgeeks.org/python-docstrings/), and r2readthedocs, and [roxygen2](https://cran.r-project.org/web/packages/roxygen2/index.html) for R, will also help to improve reproducibility. We used Sphinx for the documentation of the sFSS Navigator.* |
61 | 88 |
|
62 | | -*Ensure that you have properly documented your code.* *Not all types of software documentation on this list need to be written for a single research or support project but a combination of several should be selected depending on the nature of the project. Whether more or less documentation is needed for your project will depend on its scale and complexity. For a research project you need at least to write (external) source code documentation and user documentation.* |
| 89 | +*There are different types of documentation:* |
63 | 90 |
|
64 | 91 | - *Requirements Specification* |
65 | 92 |
|
66 | 93 | - *Software Design* |
67 | 94 |
|
68 | 95 | - ***(External) source code documentation*** |
69 | 96 | - *Place a brief explanatory comment at the start of every program.* |
70 | | - |
| 97 | + |
71 | 98 | - *Document the input and output of your script/functions.* |
72 | 99 | - *Describe what the code is doing and why.* |
73 | | - |
| 100 | + |
74 | 101 | - *Testing Requirements* |
75 | 102 | - ***End-User Instructions (including a quick-start guide)*** |
76 | 103 | - *How to install and configure the software.* |
|
79 | 106 | - *Under what license it’s released.* |
80 | 107 | - *Include a help command for command line interfaces* |
81 | 108 |
|
| 109 | +In bold the documentation that should be provided at a minimum in the context of ENCORE. |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | +***Integrated development environment** (IDE)* |
| 114 | + |
| 115 | +*Integrated Development Environments help to improve software. Consider using an IDE, e.g., [Visual Studio Code](https://code.visualstudio.com/), PyCharm and DataSpell from JetBrains (https://www.jetbrains.com/), RStudio (https://www.rstudio.com/).* |
| 116 | + |
| 117 | +*IDEs offer a various advantages:* |
82 | 118 |
|
| 119 | +* *Build in compilation and build tools* |
| 120 | +* *Code editing features (e.g., syntax highlighting, code completion, code refactoring)* |
| 121 | +* *Code debugging and testing* |
| 122 | +* *Code documentation* |
| 123 | +* *Integration with versioning systems* |
| 124 | +* *Integration with AI-based tools such as Copilot* |
| 125 | +* *Extensibility (plugins) and Customization (workflow)* |
83 | 126 |
|
84 | | -***Version control your documentation.*** |
85 | 127 |
|
86 | | -*Keep your documentation inside your Git repository along with the rest of your files. In addition/alternatively ‘Read the Docs’ (https://readthedocs.org/) provides an approach for hosting and automatically building documentation.* |
| 128 | + |
| 129 | +***AI-based tools*** |
| 130 | + |
| 131 | +*Large Language Models (LLMs) increasingly play a role in software development, testing, and documentation (e.g., Copilot, ChatGPT). Copilot is also integrated with GitHub Codespaces. It is worthwhile to try out these new tools.* |
87 | 132 |
|
88 | 133 |
|
89 | 134 |
|
|
93 | 138 |
|
94 | 139 |
|
95 | 140 |
|
| 141 | +*<u>Instructions</u>:* |
| 142 | + |
| 143 | +* *Remove all Instructions and the Explanation once you have completed the template.* |
| 144 | +* *Level of detail: Information provided should be sufficient for someone who was not involved in the project and/or has limited knowledge about the topic, to understand and reproduce the project.* |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | +***Software documentation*** |
| 149 | + |
| 150 | +*Ensure that you have properly documented your code.* *Not all types of software documentation of the list above need to be written for a single research or support project but a combination of several should be selected depending on the nature of the project. Whether more or less documentation is needed for your project will depend on its scale and complexity. For a research project you need at least to write (external) source code documentation and user documentation.* |
| 151 | + |
| 152 | + |
| 153 | + |
96 | 154 | ====== TEMPLATE STARTS HERE ====== |
97 | 155 |
|
98 | 156 |
|
|
0 commit comments