Tag Info

New answers tagged

6

As someone who was actually working at Zope Corporation (then still called Digital Creations) when the term came into being, I can emphatically state it is very much not derogatory. The term is a tongue-in-cheek reference to runtime patching (or dynamic patching, if you will). We talked about sneaking in and altering Python code at runtime; the term ...


1

Ruby and its commonly used libraries and gems tend to blur the lines between method/property and key/property using attr_accessor, essentially giving an object both a property and getter/setter methods in one line. Either explicitly or implicitly, you'd have def tentacles_count @tentacles_count end def tentacles_count=(n) @tentacles_count = n end def ...


-1

It boils down to the simple fact that you have to decide which cases you need to cover. If you need to be sure of the database connection, you have to test it. Tests are separated in groups based on what they test (unit, integration and system), where only system tests would make real calls to a database (or other external services). Each type of test ...


1

The first and most important test of a component is to test the external interfaces. Write those tests first, and make sure they are comprehensive. Then add some more. Then review them, find out which cases are missing, and add them. Then add some more. Write lower level (i.e. class-as-unit) tests only when: your higher-level (i.e. component-as-unit) ...


1

I see unit tests as routines that test pieces of code that are in a code base that you manage. Mocking and stubbing helps focus only on the flow and logic of your code, which is what you are testing in your unit tests. Whether or not an outside service like a database (which is not inherently part of your code) actually works is not important for unit ...


0

So should I have a subset of tests that do test such connectivity at least and some simple operations, for example creating a record in the primary transaction detail table, even if most of the foreign keys are stubbed out? Unit tests can and should never replace integration tests. That is, when testing the data layer you should always use integration ...


0

I would say that this is one of those situations that could justify the use of Single Table Inheritance (STI). For the rails implementations see the API. The nice thing about using STI in this case would be that you store all the data in a single table, but are able to provide different 'windows' on it through the various child models. This way you keep the ...


0

There is a 4th option, that's used in the most 'serious;' web sites like banks or other financial services: the n-tier approach which is a little like CGI, except the CGI process runs on a different server, the webserver code is very thin (just enough to reformat data into html) and calls the 'cgi' services via network protocols such as RPC or SOAP. Its ...



Top 50 recent answers are included