Nine Steps to Start a Software Project
The basic steps to starting your own software project, agile or not, based on general definitions of what needs to be done.
Join the DZone community and get the full member experience.Join For Free
agile or not, a software project starts with a requirements analysis and definition. we basically define what needs to be done somehow, be it on a piece of napkin or a 100-page word document. the next step is to turn this into a working piece of software as fast as possible and by spending as few dollars as possible. ideally, this prototyping takes a week and is made by an architect working solo . once the "skeleton" is ready, we start putting software "meat" on it. we recruit a team of programmers for that or outsource it. i see nine important steps in the skeleton creation part; let me show you them one by one.
ying xiong (2002) by yimou zhang
let's use some examples to make this more illustrative. let's say i'm a software architect and the project is a "google killer." we're hired to create a new search engine, and my job is to turn requirements into a prototype, a.k.a. a skeleton or a proof of concept. this is what i have as an input (let's say it's a piece of napkin ... what else would it be for a google killer, right?):
each page is ranked by the number of mentions in social networks like twitter, linkedin, facebook, etc. the more mentions it has, the higher the rank and the higher its position in the search results page.
seems like a doable project to me, and the requirements document is clear enough. it doesn't say anything about performance, but i can assume that it has to be as fast as google. the same goes for scalability, stress resilience, etc.
i'm not going to discuss how the software is created in a specific technical stack. that's not important for this article. what's important now is how my programming work will be "wrapped." in other words, what will i hand off to the team of programmers after a week of hard work — what is my product, or more formally, my deliverables .
thus, let's assume i managed to create a piece of software and it works.
decisions and alternatives
first of all, i have to document my key technical decisions and their alternatives.
usually work in github, and the best documentation media is the
file in the root directory of the repo. i just put my text there in a plain markdown format. that's enough for a good technical document — it has to be short; that's important.
for each decision i made, there has to be at least one alternative that i considered and rejected. there are two items at the top of my list:
apache lucene is a search engine. it is popular, mature enough, scalable, and written in java. alternatives are solr, sphinx, gigablast, and many others. java 8 is a programming language, and jvm is a runtime platform. i know how they work, and the team has enough experience with them. alternatives are ruby, python, go, scala, and tons of others.
these decisions are very high-level, but i still need to document them. as you see, i'm not explaining in details why the alternatives were rejected, and it's my choice. if someone questions my decisions in the future, they may say that the alternatives were not analyzed properly. it will be clear whose fault it was — mine. so i'm taking full responsibility for these two choices i've made: lucene and java 8.
yet another item to the list:
three modules make up the app: ui, scraper, and analyzer. they are fully decoupled and communicate strictly through lucene. i don't see any alternatives.
then, i attach a simple diagram to illustrate my decision:
as you see, in this case, i totally ignored all alternatives. i didn't even mention them. again, i take full responsibility for that; i said, "i don't see any alternatives." if, later, a better alternative is discovered, it will be obvious why we overlooked it and whose fault it was. it's not only about punishment but about discipline and traceability of decisions. each decision must be traceable to the person who made it. this helps us avoid bad decisions in the future and makes the entire project more maintainable and transparent.
let's add one more decision to the list:
takes framework is used for ui. it helps keep our code truly object-oriented, testable, fast, and decoupled from the data model. alternatives: - spring: it is big, complex, and ugly - play: similar to spring, big and ugly - spark: not as clear as takes
in this case, i documented the alternatives and gave my reasons why they are not good for us. as you see, the reasons are very biased; i basically expressed my personal opinions about these three frameworks and definitely gave preference to my own open source takes framework. is it good? no, it's not. but i'm the architect , and i do what i think is right for the project.
i'm trying to show that the point of this documentation is for me, the architect, to explain my way of thinking — no matter how bad, biased, or irrational it was. i have to write my decisions down and let the project know them all.
i would suggest you keep the number of documented decisions somewhere between four and 12 . if there are fewer than four, i probably forgot to document something important. more than 12 — i'm documenting too many non-important decisions. i should use other media for that, like javadoc blocks or responsive classes.
the next chapter in the
file has to explain how exactly i managed to address all concerns expressed in the initial requirements. i mentioned above that it goes without saying that our system must be as fast and scalable as google. thus, let's say there are two "concerns" — performance and scalability.
as a software architect, i must address them both. in other words, i have to prove that my solution is fast and scalable. maybe it's not, but if i believe it is, i have to explain why i think so. i can't be quiet about the concerns. here is what i would say about performance:
the system is as fast as the lucene search engine, while lucene is rather fast even with large amounts of data.
and this one is about scalability:
the bottleneck is in lucene, and it is scalable vertically. not sure about horizontal scalability.
as you see, i'm trying to be honest and tell the truth. we'll be able to review these statements later and decide whether i was right or wrong. but we need to have my answers to all concerns expressed in the requirements.
the next section is about assumptions i've made while working with the prototype. we usually make assumptions when we don't have enough factual information, and we basically fill the gaps. there is nothing wrong with it, but we have to document which gaps were filled and why.
how about these two assumptions:
1. i assume that social platforms won't block our calls and will provide counters for all pages. 2. i assume that lucene will be enough for both indexing and data storage, so we won't need a database engine.
i made these assumptions without proper analysis of the situation. i don't know whether twitter will be happy to see millions of requests every hour coming from our server or not. maybe it will ban us; i don't know. i don't have to evaluate this and find an exact answer. i just made an assumption and documented it.
will it be enough to have lucene only, without any additional data persistence layer? i don't know, but i hope so. i don't have time to do a detailed analysis of our entire data model and its potential future requirements. i just make an assumption and call it a day.
if later, during the handoff, the project sponsor says this assumption exposes too much risk for the project, we'll do a better analysis. for now, my job is to document what i see and move on. remember, i have just a week of time.
now i list all potential problems i forsee and estimate their probability and impact. let me show you an example first:
1. lucene may not be able to handle billions of documents [6x9] 2. social platforms will ban our requests [8x9]
the first number in square brackets is the probability and the second one is the impact, on a 0 to 9 scale. if both numbers are nine, it's not a risk anymore; it's a fact. if both numbers are zero, we can simply ignore this risk.
i listed just two, but in a real system there should be somewhere between four and 12 risks. too many risks is a sign that the prototype is not focused enough, while too few is due to a lack of attention.
now i have to make sure the product is "wrapped" in continuous integration, which is a critical component of any software package. i have to configure it, preferably in the cloud , and make sure the build is clean.
it is also important to make sure the continuous integration pipeline covers all critical areas, including:
- building on multiple platforms, such as linux, windows, and mac.
- running integration tests and unit tests.
- analyzing statically.
- collecting test coverage.
- generating documentation.
the stricter the pipeline, the better it is for the project. at this stage, my job, as an architect, is to build a "guard wall" around the product to protect it against future chaos . the chaos will come from programmers making changes through pull requests. they will care much less about the entire quality of the product than i do, and that's why i have to incorporate tools that keep the situation under control.
my goal is to make the continuous integration pipeline as fragile as possible. any minor error should lead to a build failure. of course, i'm talking about reproducible failures. the build should fail in a predictable way, not sporadically.
this is yet another critical component of any software project. you have to analyze the quality of code statically. in the most primitive approach, a static analysis will check the formatting of your source code and fail the build when that formatting is broken. however, in a more advanced variant, static analysis will catch many important bugs.
it is called "static" becuase it doesn't require the software to be running. to the contrary, unit tests validate software quality in runtime by running the app.
there are many static analysis tools, for almost every language and format. i strongly recommend you use them. moreover, i recommend you configure them as strictly as possible in order to make the build as fragile as you can. the fragility of the build is a key success factor in software development.
test coverage must be collected on every build and, at the very least, reported. in an ideal scenario, low test coverage must fail the build. let's say i set the required percentage of coverage to 75 percent (it's actually a more complex metric, but in a primitive approach just one number is enough). if someone introduces a new class without a unit test, the coverage percentage goes down and the build breaks.
my job, as an architect creating a prototype, is to make sure the coverage is calculated on every build and is under control — it can't go lower than the threshold i set.
no matter how low the threshold is, what matters is whether it is under control or not.
this is the final step before the handoff. i have to configure a continuous delivery pipeline to make sure the product is packaged and deployed in one click. this is a very important — critically important — step. without it, everything done before and the piece of software itself is just a collection of files. a piece of software is a product when it is packagable and deployable in one click.
"pipeline" means that there are a number of elements chained sequentially; for a java application, for example:
- run automated build (the same as in continuous integration)
- package jar file
- upload jar file to repository
- build javadoc site
- upload javadoc site to amazon s3
i'm using rultor to automate the entire pipeline and simplify its start, stop, and logging. i just post a "please release now" message to a github ticket, and the product is packaged and deployed in a few minutes.
the last step is the handoff — i have to present my solution to the project manager, the sponsor of the project, and the team. everybody has to accept it. it doesn't mean they will like it, and that's not the goal. the goal is to deliver a complete solution, with risks, assumptions, decisions documented, continuous integration configured, static analysis enforced, etc. if my solution won't be good enough for their criteria, they will change the architect and try again.
my objective is not to satisfy them but to do the best i can according to the requirements and my professional understanding of the problem and business domains. i wrote about this some time ago: a happy boss is a false objective . again, my objective is not to make them happy. instead, my objective is to make a perfect prototype, the way i understand the word perfect . if i fail, i fail. the project will get another architect and try again.
that's it. the skeleton is ready, and my job is done.
Published at DZone with permission of Yegor Bugayenko. See the original article here.
Opinions expressed by DZone contributors are their own.