{
    "componentChunkName": "component---src-templates-post-page-js",
    "path": "/2018/cryptomate/requirements",
    "result": {"data":{"site":{"siteMetadata":{"title":"Solid Abstractions","siteUrl":"https://solidabstractions.com","twitterId":291334023,"author":{"fullName":"Julien Hartmann","profileHtml":"I am an open-source de­vel­op­er, for­mer IT con­sul­tant with a pas­sion for new tech­nol­o­gies. I be­lieve the role of an en­gi­neer is to em­pow­er peo­ple, by as­sem­bling sim­ple, re­fined de­signs.\n","links":[{"url":"https://github.com/spectras/","name":"github","title":"GitHub"},{"url":"https://stackoverflow.com/users/3212865/spectras","name":"stackoverflow","title":"StackOverflow"},{"url":"https://www.linkedin.com/in/julienhartmann/","name":"linkedin","title":"LinkedIn"}],"profilePicNode":{"original":{"src":"/static/profile-pic-301a9cbe7b572c3e7910c9717d2b3bcd.jpg"}},"url":"https://etherdream.org/about"}}},"markdownRemark":{"id":"36767bd7-5442-51c7-964f-289ee39ead61","excerpt":"Constraints, functional requirements, quality attributes. All of those are known as\narchitecturally significant requirements. Characterizing those is the final step\nin our initial “understand phase”.","html":"<p>Constraints, functional requirements, quality attributes. All of those are known as\narchitecturally significant requirements. Characterizing those is the final step\nin our initial “understand phase”.</p>\n<p>--- excerpt ---</p>\n<p>They may be given as <strong>constraints</strong>, that is, predefined decisions that may not change.\nThey may be implied by user stories, making them <strong>functional requirements</strong>. They may be general\ndesirable <strong>qualities</strong> in connection with business goals of <a href=\"stakeholders\" class=\"internal\">stakeholders</a>.</p>\n<p>All of those are known as <em>architecturally significant requirements</em>. That is, requirements\nthat strongly influence architecture choices. Characterizing those is the final step\nin our initial “understand phase”.</p>\n<h2 id=\"constraints\">Constraints</h2>\n<p>Most come from stakeholders' goals. A few other ones are here to make my life as\na developer easier on this project.</p>\n<table>\n<thead>\n<tr>\n<th>Origin</th>\n<th>Constraint</th>\n<th>Detail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Manager</td>\n<td>Initial release must be ready by end of Q4 2018.</td>\n<td></td>\n</tr>\n<tr>\n<td>Manager</td>\n<td>Must use free tools only.</td>\n<td>As an illustrative project, it has no allocated budget.</td>\n</tr>\n<tr>\n<td>Manager</td>\n<td>Must be Open Source software</td>\n<td>Project will be used to write articles on a website.</td>\n</tr>\n<tr>\n<td>Manager</td>\n<td>Must support at least two of Binance, Bitfinex, Bitstamp and Bittrex marketplaces.</td>\n<td>Those are common and renowned marketplaces, good initial candidates to gain visibility.</td>\n</tr>\n<tr>\n<td>Developer</td>\n<td>Must run on Linux</td>\n<td>Easier to develop and maintain, and no willingness to mess with Win32 oddities.</td>\n</tr>\n<tr>\n<td>Developer</td>\n<td>Must use only C/C++/Python/JavaScript for development</td>\n<td>Best knowledge at this point in time, will make for more efficient development.</td>\n</tr>\n<tr>\n<td>Developer</td>\n<td>Must work in detached mode, as a background job with a controlling interface.</td>\n<td>This follows the tradition of Unix modular architecture.</td>\n</tr>\n</tbody>\n</table>\n<h2 id=\"influential-functional-requirements\">Influential functional requirements</h2>\n<div class=\"note\"><p>As the point of this article series is architecture and implementation, I\nintentionally skipped writing formal requirements.</p></div>\n<blockquote>\n<p>An influential functional requirement is a requirement that has an impact on system architecture.</p>\n</blockquote>\n<p>The point is not to recreate project's functional requirements. Rather, it is to identify\nkey requirements that could make our architecture fail badly should we omit them in our design.</p>\n<p>Usually, interactions with people or with external system are good candidates.</p>\n<ul>\n<li>Cryptomate shall gather real-time data from market data providers.</li>\n<li>\n<p>Cryptomate shall react to data updates in real time, according to a predefined strategy:</p>\n<ul>\n<li>Strategy shall be user-defined.</li>\n<li>Strategy shall allow users to compose and test indicators arbitrarily.</li>\n<li>Strategy shall be able to cross-analyze several markets.</li>\n</ul>\n</li>\n<li>\n<p>Cryptomate shall allow strategies to trigger market orders on trading platforms.</p>\n<ul>\n<li>It shall be able to open orders, cancel orders and monitor order fill.</li>\n</ul>\n</li>\n<li>Cryptomate shall send notifications on order fill, errors and user-defined strategy events.</li>\n<li>Cryptomate shall produce auditing tracks of its activity.</li>\n</ul>\n<h2 id=\"quality-attributes\">Quality attributes</h2>\n<blockquote>\n<p>A quality attribute describes visible properties of the solution and expectations of how\nwell it performs its role.</p>\n</blockquote>\n<p>As much as possible, we want to describe those quality attributes through scenarios,\nquantifying the characteristics of solution's response to specific stimuli.</p>\n<p>There are many possible quality attributes. This section only includes the ones identified\nwhile establishing stakeholder's business goals. All items in this section either are taken\nstraight from <a href=\"stakeholders\" class=\"internal\">stakeholders' goals</a>, or result from refining\none of those goals into multiple scenarios.</p>\n<h3 id=\"modifiability\">Modifiability</h3>\n<p>Represents the cost of changing the product. In our case, it can be split into maintainability\nand testability.</p>\n<h4 id=\"maintainability\">Maintainability</h4>\n<blockquote>\n<p>Maintainability is the capacity of a system to be modified in order to fix defects,\nmeet new requirements and manage technical debt.</p>\n</blockquote>\n<p>Scenarios :</p>\n<ul>\n<li>User wants access to a new market data provider. ➤ Adding support should touch no existing code.</li>\n<li>User wants access to a new trading platform. ➤ Adding support should touch no existing code.</li>\n<li>User wants a new indicator module. ➤ Adding it should touch no existing code.</li>\n<li>User wants to send notifications to a new message broker. ➤ Adding support should touch no\nexisting code.</li>\n</ul>\n<h4 id=\"testability\">Testability</h4>\n<blockquote>\n<p>Testability is the capacity of a system to facilitate the establishment of tests and\ncheck that validation criteria are met.</p>\n</blockquote>\n<p>Scenarios :</p>\n<ul>\n<li>End user, in a normal environment, requests market data provider connectivity check. ➤ The test\ncompletes within 10s, with a full report of provider connectivity, including latest data time\nand last error, if any.</li>\n<li>End user, in a normal environment, requests a trading platform connectivity check. ➤ The test\ncompletes within 10s with a report, including platform response time, API key validity and\nlast error, if any.</li>\n<li>Dev user, in a testing environment, performs integration tests. ➤ They are able to automatically\ncontrol the system within 5 minutes and at the end of the test 95% coverage is achieved.</li>\n<li>Developers, in a testing environment, perform unit tests. ➤ They are able to automatically\ncontrol the system within 5 minutes and at the end of the test 100% module coverage is achieved.</li>\n</ul>\n<h3 id=\"run-time-attributes\">Run-time attributes</h3>\n<h4 id=\"performance\">Performance</h4>\n<blockquote>\n<p>Performance is the ability of the system to achieve required functionality within\ntime, space and cost constraints.</p>\n</blockquote>\n<p>Scenarios :</p>\n<p>Those assume consumer-grade hardware, with 100 active strategies. Current state examining at\nmost one Cryptomate-provided indicator, and no throttling restrictions coming into play.</p>\n<ul>\n<li>New market data is received. ➤ The outgoing requests of any resulting order opening or\ncancelling directives, and any notification must be seen within 1 second\nof receiving the new data.</li>\n<li>Strategy management directives (such as enable / pause / resume…) are received. ➤ A\nconfirmation or error must be sent back within 15 seconds.</li>\n</ul>\n<h4 id=\"reliability\">Reliability</h4>\n<blockquote>\n<p>Reliability is the ability of the system to recognize the failure of an internal component\nand maintain its correctness (either by compensating the fault or reporting it).</p>\n</blockquote>\n<p>Scenarios :</p>\n<ul>\n<li>The market data provider fails to provide meaningful, valid data. ➤ The system must\nsend an error notification within 1 minute and close open positions\ndepending on user settings.</li>\n<li>The trading platform fails to respond to Cryptomate requests. ➤ The system must\nsend an error notification within 10 seconds.</li>\n<li>The notification service fails to respond to Cryptomate requests. ➤ The system, if so\nconfigured, must stop all running strategies and close open positions within 1 minute.</li>\n</ul>\n<h4 id=\"availability\">Availability</h4>\n<blockquote>\n<p>Availability characterizes system response to failures and the associated consequences.</p>\n</blockquote>\n<p>Scenarios :</p>\n<ul>\n<li>Upon starting the system, strategies that were active when it was stopped, either gracefully\nor forcedly, should resume within one minute.</li>\n<li>The system should work reliably when receiving duplicate data, so market data redundancy can\nbe implemented by fetching data over more than one physical link.</li>\n</ul>\n<h4 id=\"scalability\">Scalability</h4>\n<blockquote>\n<p>Scalability is the ability of the system to handle an increasing amount of work. This\nincludes the ability to accommodate additional resources.</p>\n</blockquote>\n<ul>\n<li>When adding new instances of the engine to implement horizontal scaling,\nthey should share the inbound market data feeds.</li>\n</ul>\n<h3 id=\"usability\">Usability</h3>\n<blockquote>\n<p>Usability is the ability of the system to enable users to accomplish desired tasks\nin the most efficient / comfortable / … way.</p>\n</blockquote>\n<p>I will leave this part out intentionally for now, we will come back to it when designing\nuser interactions. As we have a constraint that the system is detached from any user\ninterface, we should have a high level of decoupling, making the UX almost a separate project.</p>\n<h3 id=\"security\">Security</h3>\n<h4 id=\"authenticity\">Authenticity</h4>\n<blockquote>\n<p>Authenticity is the trust the system can have that data and messages are from the sender\nthey claim to be from.</p>\n</blockquote>\n<ul>\n<li>When connecting to market data providers, the system must authenticate the remote end,\nand abort if it fails to do so. ➤ The event shall be logged.</li>\n<li>When receiving directives through its controlling interface, the system must authenticate\nthe remote end and reject the directive if it fails to do so. ➤ The event shall be logged.</li>\n<li>When sending orders to trading platforms, the system must authenticate the remote end,\nand abort, not disclosing the order if it fails to authenticate. ➤ The event shall be logged.</li>\n</ul>\n<h4 id=\"confidentiality\">Confidentiality</h4>\n<blockquote>\n<p>Confidentiality is the ability of the system to keep some information and services private.</p>\n</blockquote>\n<ul>\n<li>When writing strategy configuration, user credentials or system state to persistent storage,\nthey must be encrypted so they remain private even on untrusted persistent storage.</li>\n</ul>\n<h4 id=\"integrity\">Integrity</h4>\n<blockquote>\n<p>Integrity is the ability of the system to ensure information has not been corrupted or tampered with.</p>\n</blockquote>\n<ul>\n<li>When loading market data history, the system must check data integrity, and not use the\nhistory. ➤ The event shall be logged.</li>\n<li>When loading strategy configuration and state, the system must check their integrity, and\nabort loading if the check fails. ➤ The event shall be logged.</li>\n</ul>\n<h4 id=\"audit-ability\">Audit-ability</h4>\n<blockquote>\n<p>Audit-ability is the capacity of the system to keep adequate records to support audits\nand investigations.</p>\n</blockquote>\n<ul>\n<li>If so configured, the system shall record every step taken by a strategy. Recorded data\nmust include reason for taking the step and outcome of actions performed.</li>\n</ul>\n<h2 id=\"conclusion\">Conclusion</h2>\n<p>We now have a full view of what features and which quality attributes will have an impact\non the architecture of our solution. At that point, we should consolidate all the knowledge\ngathered so far into an architecture-significant requirement workbook. This is a living document\nthat we will update as we encounter new elements we missed in the initial design phase,\nhopefully as few as possible.</p>\n<p>In the <a href=\"modules\" class=\"internal\">next post</a>, we will use that knowledge to create a high-level\narchitecture from common designs, possibly compositing them for our system.</p>","fields":{"isPage":false,"slug":"/2018/cryptomate/requirements"},"frontmatter":{"title":"Requirements and Quality Attributes","classname":null,"date":"2018-08-06T00:00:00.000Z","formattedDate":"August 06, 2018","isoDate":"2018-08-06T00:00:00+00:00"},"headings":[{"value":"Constraints","depth":1},{"value":"Influential functional requirements","depth":1},{"value":"Quality attributes","depth":1},{"value":"Modifiability","depth":2},{"value":"Maintainability","depth":3},{"value":"Testability","depth":3},{"value":"Run-time attributes","depth":2},{"value":"Performance","depth":3},{"value":"Reliability","depth":3},{"value":"Availability","depth":3},{"value":"Scalability","depth":3},{"value":"Usability","depth":2},{"value":"Security","depth":2},{"value":"Authenticity","depth":3},{"value":"Confidentiality","depth":3},{"value":"Integrity","depth":3},{"value":"Audit-ability","depth":3},{"value":"Conclusion","depth":1}],"image":null,"series":{"name":"cryptomate","fullName":null,"fields":{"slug":"/cryptomate"}},"tags":[{"name":"architecture","slug":"/tag/architecture"}]}},"pageContext":{"series":"cryptomate","slug":"/2018/cryptomate/requirements","previous":{"fields":{"slug":"/2018/cryptomate/stakeholders"},"frontmatter":{"title":"Stakeholders and Goals","series":"cryptomate"},"tags":[{"name":"architecture","slug":"/tag/architecture"}]},"next":{"fields":{"slug":"/2018/cryptomate/modules"},"frontmatter":{"title":"Modules and Components","series":"cryptomate"},"tags":[{"name":"architecture","slug":"/tag/architecture"}]},"seriesPrevious":{"fields":{"slug":"/2018/cryptomate/stakeholders"},"frontmatter":{"title":"Stakeholders and Goals","series":"cryptomate"},"tags":[{"name":"architecture","slug":"/tag/architecture"}]},"seriesNext":{"fields":{"slug":"/2018/cryptomate/modules"},"frontmatter":{"title":"Modules and Components","series":"cryptomate"},"tags":[{"name":"architecture","slug":"/tag/architecture"}]}}},
    "staticQueryHashes": ["1733002695","4006707078"]}