{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Introduction\n", "\n", "Developers may have a hard time to learn from past failures or bugs in the application due to team autonomy, constant pressure to deliver and a heavily distributed code base. How can they achieve that past errors are avoided in future development activities?\n", "\n", "Neal Ford, Rebecca Parsons and Patrick Kua are proposing fitness functions that check for certain qualities in software applications in their book \"Building Evolutionary Architectures: Support Constant Change\". Also, Neal is speaking particular\n", "\n", "In this notebook, I take this idea to show you a possible implementation of fitness functions using Jupyter notebooks!" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "%load_ext cypher" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "4 rows affected.\n" ] }, { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PackageCycle
{'fqn': 'org.springframework.samples.petclinic.model', 'fileName': '/org/springframework/samples/petclinic/model', 'name': 'model'}['org.springframework.samples.petclinic.repository', 'org.springframework.samples.petclinic.model']
{'fileName': '/org/springframework/samples/petclinic/repository', 'fqn': 'org.springframework.samples.petclinic.repository', 'name': 'repository'}['org.springframework.samples.petclinic.model', 'org.springframework.samples.petclinic.repository']
{'fileName': '/org/springframework/samples/petclinic/service', 'fqn': 'org.springframework.samples.petclinic.service', 'name': 'service'}['org.springframework.samples.petclinic.web', 'org.springframework.samples.petclinic.service']
{'fqn': 'org.springframework.samples.petclinic.web', 'fileName': '/org/springframework/samples/petclinic/web', 'name': 'web'}['org.springframework.samples.petclinic.service', 'org.springframework.samples.petclinic.web']
" ], "text/plain": [ "[[{'fqn': 'org.springframework.samples.petclinic.model',\n", " 'fileName': '/org/springframework/samples/petclinic/model',\n", " 'name': 'model'},\n", " ['org.springframework.samples.petclinic.repository',\n", " 'org.springframework.samples.petclinic.model']],\n", " [{'fileName': '/org/springframework/samples/petclinic/repository',\n", " 'fqn': 'org.springframework.samples.petclinic.repository',\n", " 'name': 'repository'},\n", " ['org.springframework.samples.petclinic.model',\n", " 'org.springframework.samples.petclinic.repository']],\n", " [{'fileName': '/org/springframework/samples/petclinic/service',\n", " 'fqn': 'org.springframework.samples.petclinic.service',\n", " 'name': 'service'},\n", " ['org.springframework.samples.petclinic.web',\n", " 'org.springframework.samples.petclinic.service']],\n", " [{'fqn': 'org.springframework.samples.petclinic.web',\n", " 'fileName': '/org/springframework/samples/petclinic/web',\n", " 'name': 'web'},\n", " ['org.springframework.samples.petclinic.service',\n", " 'org.springframework.samples.petclinic.web']]]" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%cypher\n", "MATCH\n", " (p1:Package)-[:DEPENDS_ON]->(p2:Package),\n", " path=shortestPath((p2)-[:DEPENDS_ON*]->(p1))\n", "WHERE\n", " p1<>p2\n", "RETURN\n", " p1 AS Package, EXTRACT(p IN nodes(path) | p.fqn) AS Cycle\n", "ORDER BY\n", " Package.fqn" ] } ], "metadata": { "hide_input": false, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.4" }, "toc": { "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "toc_cell": false, "toc_position": {}, "toc_section_display": "block", "toc_window_display": false }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }