{"action":"opened","issue":{"url":"https://api.github.com/repos/18F/crime-data-api/issues/118","repository_url":"https://api.github.com/repos/18F/crime-data-api","labels_url":"https://api.github.com/repos/18F/crime-data-api/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/18F/crime-data-api/issues/118/comments","events_url":"https://api.github.com/repos/18F/crime-data-api/issues/118/events","html_url":"https://github.com/18F/crime-data-api/issues/118","id":191751665,"number":118,"title":"Clarify testing approach","user":{"login":"harrisj","id":2044,"avatar_url":"https://avatars.githubusercontent.com/u/2044?v=3","gravatar_id":"","url":"https://api.github.com/users/harrisj","html_url":"https://github.com/harrisj","followers_url":"https://api.github.com/users/harrisj/followers","following_url":"https://api.github.com/users/harrisj/following{/other_user}","gists_url":"https://api.github.com/users/harrisj/gists{/gist_id}","starred_url":"https://api.github.com/users/harrisj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrisj/subscriptions","organizations_url":"https://api.github.com/users/harrisj/orgs","repos_url":"https://api.github.com/users/harrisj/repos","events_url":"https://api.github.com/users/harrisj/events{/privacy}","received_events_url":"https://api.github.com/users/harrisj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-25T18:30:26Z","updated_at":"2016-11-25T18:30:26Z","closed_at":null,"body":"Right now, we have very little test coverage for the application. This is totally to be expected since the app is still in a prototyping phase, but it is something we will have to fix before we get too far into active development so that we can use a test-driven approach to keep up code quality. It seems like we have several options:\r\n\r\n1. Use the test database slice that Catherine has shared with developers for trying out the app locally. This has the advantage of mimicking what real data would look like in the system because it _is_ real data. The issue is that it's unclear that we can put this data in source control, since that would mean making it public, which means that we can't use CircleCI or any other CI backend to run our tests and validate pull requests (instead, developers would need to locally run tests before PR create and to review PRs and make sure any changes they make to the test DB are synced among all developers). I think this will negatively impact our velocity and we need some way to get an test dataset we can share publicly.\r\n\r\n2. In many applications, tests will just start with empty database tables and use factories to create the data structures they need for the specific test and then tear down afterwards. Utilities like [FactoryBoy](https://factoryboy.readthedocs.io/en/latest/) can make this process easier, but it's still complex to set up factories when there are 127 related tables in the database. I think this will take a while to run.\r\n\r\n3. A hybrid approach where we start the testing from a database that contains some data (ie, code lookup tables like `refCounty`, `weaponType`, etc.) and perhaps even 1 faked agency or such and then factories to create incidents. This would allow us to avoid recreating data for tables that can be public (ie, they contain values found in the NIBRS reference for instance) but to build specific incidents or such when we need to test certain features.\r\n\r\nJust putting all this out here to start a discussion."}}
{"actor":{"display_login":"harrisj"}}