1,080 Matching Annotations
  1. Mar 2021
    1. Have you ever played the game 20 questions? Most of us have played that game at one point in our lives. One person thinks of something that could be an animal, vegetable, or mineral and then they answer yes/no questions that are asked of them. The point of the game is to ask as few questions as possible in order to accurately guess what the person is thinking.  This is how I think of the unit tests that I write the specified behavior as I’m doing test-first development. I ask what are the fewest tests that I need to write in order to assert the behavior I want to create.
    2. So the question becomes how many tests are enough?
    3. I am a big advocate of having a complete test base and even erring on the side of caution when it comes to quality engineering and software validation but that is not what we’re talking about here. What we’re talking about here are the tests that we write when we’re doing test-first development and I’m proposing that writing those tests from the perspective of specifying the behaviors that we want to create is a highly valuable way of writing tests because it drives us to think at the right level of abstraction for creating behavioral tests and that allow us the freedom to refactor our code without breaking it.
    4. The number one problem that I see developers have when practicing test-first development that impedes them from refactoring their code is that they over-specify behavior in their tests. This leads developers to write more tests than are needed, which can become a burden when refactoring code.
    1. In production, you will never trigger one specific callback or a particular validation, only. Your application will run all code required to create a Song object, for instance. In Trailblazer, this means running the Song::Create operation, and testing that very operation with all its side-effects.
    2. There’s no need to test controllers, models, service objects, etc. in isolation
    3. Run the complete unit with a certain input set, and test the side-effects. This differs to the Rails Way™ testing style, where smaller units of code, such as a specific validation or a callback, are tested in complete isolation. While that might look tempting and clean, it will create a test environment that is not identical to what happens in production.
    4. Integration tests for controllers: These Smoke tests only test the wiring between controller, operation and presentation layer.
    5. Unit tests for operations: They test all edge cases in a nice, fast unit test environment without any HTTP involved.
    6. This helper allows you to mock any step within a given or deeply nested activities.
    7. To skip processing inside :load_user and use a mock instead, use mock_step.
    1. Erich Neuwirth. (2020, November 11). #COVID19 #COVID19at https://t.co/9uudp013px Zu meinem heutigen Bericht sind Vorbemerkungen notwendig. Das EMS - aus dem kommen die Daten über positive Tests—Hat anscheinend ziemliche Probleme. Heute wurden viele Fälle nachgemeldet. In Wien gab es laut diesem [Tweet]. @neuwirthe. https://twitter.com/neuwirthe/status/1326556742113746950

  2. Feb 2021
    1. Miro Weinberger. (2020, December 3). Our 1st Covid-19 wastewater tests since Thanksgiving just came in—Virus levels are up significantly citywide. I hope that all of #BTV will look at this graph and see what I see: A call to action, to stop gathering with other households, and to get tested ASAP if you have https://t.co/8nxTwOOcFA [Tweet]. @MiroBTV. https://twitter.com/MiroBTV/status/1334613511692017664

    1. TRAILBLAZER-TEST The official stable release is only weeks away bringing you a bunch of new assertions that drastically reduce coding effort for tests! Of course, Minitest and RSpec will both be supported. TRAILBLAZER-STORY will follow as it turned out to be inevitable for setting up application state for tests. Instead of fumbling around with factories and traits in your tests, you “tell a story” about what to create in which order, easily customizable, and all written using activities. Currently, I’m working on designing the interfaces and it’s real fun!
  3. Jan 2021
    1. I think I'm seeing some weird behavior when I select "bill_length_mm" on this chart: check it out. Is that expected?

    1. // Arrange const [refDiv, contentDiv] = getElements(); const [refAction, contentAction, getInstance] = createPopperActions({ placement: 'right-start', }); mountWithAction(refDiv, refAction); // Act mountWithAction(contentDiv, contentAction); // Assert expect(getInstance()).not.toBeNull();
    1. Personally, I think you are perhaps blowing up a fairly medium-sized (and fixable) bug discovered during routine testing into extreme-case hyperbole. Again, engagement and participation will get the bug fixed faster. The entire point of testing is to discover and fix precisely these kinds of pain points before release.
  4. Dec 2020
    1. In a webinar hosted by MIT Sloan School of Management professor Andrew Lo on April 1, Bancel said that Moderna is already manufacturing mRNA for vaccines in its potential Phase II study, which could begin enrolling hundreds of people this spring, as well as its potential Phase III study, which could enroll thousands of people as early as late summer or early fall. In a US Securities and Exchange Commission filing the week before, Bancel also indicated that Moderna may request special permission to give people like doctors and nurses access to its vaccine this fall, before a formal approval. It’s an audacious plan for a company—and technology—that has yet to put a drug on the market.
  5. Nov 2020
    1. Comparison between pytest and unittes test frameworks

      Detailed comparison table of pytest vs unittest modules (check below)

  6. Oct 2020
    1. You want to write maintainable tests that give you high confidence that your components are working for your users. As a part of this goal, you want your tests to avoid including implementation details so refactors of your components (changes to implementation but not functionality) don't break your tests and slow you and your team down.

      key point. I think that this also means that NOT using data-testid is better since this is "testing library" specific attribute and 'binds' us to testin-library

    1. we are using RTL's findBy search variant to wait for element(s) which appear eventually.

      see above - this is how you'd wait async to grab the element you need

    2. For any element that isn't there yet but will be there eventually, use findBy over getBy or queryBy. If you assert for a missing element, use queryBy. Otherwise default to getBy

      key point: summary of getBy, queryBy and findBy

    3. The neat thing about getByRole: it shows all the selectable roles if you provide a role that isn't available in the rendered component's HTML:

      pass no arguments and it will list all available roles in the element you passed to it (including implicit roles)

    4. // recommended

      notice that this is the recommended practice

    5. Whereas the describe-block is the test suite, the test-block (which also can be named it instead of test) is the test case. A test suite can have multiple test cases and a test case doesn't have to be in a test suite. What you put into the test cases are called assertions (e.g. expect in Jest) which either turn out to be successful (green) or erroneous (red). Here we have two assertions which should turn out successful:

      Key point explaining key basic terms in React testign world

  7. Sep 2020
    1. Blokland, I. V. van, Lanting, P., Ori, A. P., Vonk, J. M., Warmerdam, R. C., Herkert, J. C., Boulogne, F., Claringbould, A., Lopera-Maya, E. A., Bartels, M., Hottenga, J.-J., Ganna, A., Karjalainen, J., Study, L. C.-19 cohort, Initiative, T. C.-19 H. G., Hayward, C., Fawns-Ritchie, C., Campbell, A., Porteous, D., … Franke, L. H. (2020). Using symptom-based case predictions to identify host genetic factors that contribute to COVID-19 susceptibility. MedRxiv, 2020.08.21.20177246. https://doi.org/10.1101/2020.08.21.20177246

  8. Aug 2020
    1. Vogels, C. B. F., Brackney, D., Wang, J., Kalinich, C. C., Ott, I., Kudo, E., Lu, P., Venkataraman, A., Tokuyama, M., Moore, A. J., Muenker, M. C., Casanovas-Massana, A., Fournier, J., Bermejo, S., Campbell, M., Datta, R., Nelson, A., Team, Y. I. R., Cruz, C. D., … Grubaugh, N. (2020). SalivaDirect: Simple and sensitive molecular diagnostic test for SARS-CoV-2 surveillance. MedRxiv, 2020.08.03.20167791. https://doi.org/10.1101/2020.08.03.20167791

    1. Aspelund, K. M., Droste, M. C., Stock, J. H., & Walker, C. D. (2020). Identification and Estimation of Undetected COVID-19 Cases Using Testing Data from Iceland (Working Paper No. 27528; Working Paper Series). National Bureau of Economic Research. https://doi.org/10.3386/w27528

    1. Hsieh, C.-L., Goldsmith, J. A., Schaub, J. M., DiVenere, A. M., Kuo, H.-C., Javanmardi, K., Le, K. C., Wrapp, D., Lee, A. G., Liu, Y., Chou, C.-W., Byrne, P. O., Hjorth, C. K., Johnson, N. V., Ludes-Meyers, J., Nguyen, A. W., Park, J., Wang, N., Amengor, D., … McLellan, J. S. (2020). Structure-based design of prefusion-stabilized SARS-CoV-2 spikes. Science. https://doi.org/10.1126/science.abd0826

  9. Jul 2020
    1. It would be nice if the tests weren't so implementation specific, but rather tested the essence of the functionality. I tried to make them less brittle but failed. To that end, re-writing all the tests in rspec would be (IMHO) a brilliant improvement and pave the way for better tests in the future and more flexibility in implementation.
    1. Webpacker opens the door to JavaScript unit test runners that can run in a Node.js process instead of a real browser (typically for speed). Jest, for example, executes tests against a "browser-like" environment called jsdom by default.
    1. We also use a home-made RspecFlaky::Listener listener which records flaky examples in a JSON report file on master (retrieve-tests-metadata and update-tests-metadata jobs).