2,351 reputation
1126
bio website sleepeasysoftware.com
location Los Angeles, CA 90066
age
visits member for 2 years, 6 months
seen Dec 18 at 17:49

Nov
1
comment In domain driven design, how do I convert a database table with a primary key into a Value Object?
Ah, that makes a lot of sense. Thanks for the help.
Oct
24
comment “Everything is a Map”, am I doing this right?
How did you come to that conclusion (the "it is ok" one)?
Oct
23
comment “Everything is a Map”, am I doing this right?
"In object-oriented programming, a god object is an object that knows too much or does too much. The god object is an example of an anti-pattern." So god object is not a good thing, yet your message seems to be saying the opposite. That's a little confusing to me.
Oct
22
comment “Everything is a Map”, am I doing this right?
@paul in a sense they have because it's available in ClojureScript, but I'm not sure if that "counts" in your mind. It might exist in PureScript and I believe there's at least one library that provides immutable data structures in JavaScript. I'd hope at least one of them has these, otherwise they'd be inconvenient to use.
Oct
8
comment In domain driven design, how do I convert a database table with a primary key into a Value Object?
@SpaceTrucker I don't think I've read anything that says that should factor into your decision of making a model a Value Object.
Oct
8
comment In domain driven design, how do I convert a database table with a primary key into a Value Object?
I don't feel like this is answering all (or even a majority) of my questions
Oct
7
comment In domain driven design, how do I convert a database table with a primary key into a Value Object?
Can you show some concrete implementations (can be pseudo code)?
Oct
7
comment TDD: how to test file outputs?
ApprovalTests has the same issue I mentioned in my answer (see "100 broken tests"). Although it is a good tool to be aware of, I think it's better for building a safety net around something that's difficult to test rather than an end result.
Oct
7
comment TDD: how to test file outputs?
@CésarGarcíaTapia I thought you have a library to parse the files already? I was writing my answer assuming that. There are definitely java libraries for parsing Excel files and probably PDF.
Oct
7
comment TDD: how to test file outputs?
That's another good alternative. Technically you could still be practicing TDD without doing this though as TDD doesn't have to be done with unit tests (not that you said otherwise). But, if this gives you enough confidence in your code, it'd be preferred.
Oct
6
comment What are the disadvantages of test-first programming?
Your first point is very interesting to me. How many enterprise apps are actually unit-testable? Most software uses an ORM that performs black magic and only works when deployed. Same with the front end. In DDD terms, it seems to me that only the Domain Layer can be unit tested (fortunately that's one of the most important parts). Now consider the concept of "Tracer Bullets" and the situation where you need them. How can you possibly start test first?
Jul
29
comment “Everything is a Map”, am I doing this right?
I now know why I bother passing it around even though it's a global variable: It allows me to write pure functions. If I change my gameState = f(gameState) to f(), it's much more difficult to test f. f() may return a different thing each time I call it. But it's easy to make f(gameState) return the same thing every time it's given the same input.
Jul
2
comment How can I use unit tests and TDD to test an app that relies mostly on database CRUD operations?
"The only way to test for this is to write an automated UI test to click on the button twice. Maybe check out Selenium." In situations like that, the backend better be preventing that from occurring, otherwise the UI would have direct access to the database.
Jul
1
comment How can I use unit tests and TDD to test an app that relies mostly on database CRUD operations?
I don't think you responded to my first sentence.
Jun
30
comment How can I use unit tests and TDD to test an app that relies mostly on database CRUD operations?
As I said, "The majority of our bugs involve JPA in one way or another.", I think the article's advice would miss all of those. Also, if you consider those Java/C# tests to still be unit tests, we've got very different definitions. I think this is good advice in general, but it still seems like it would take a ton of time to deploy and run the suite and therefore not conducive to TDD. Do you disagree?
Jun
30
comment How can I use unit tests and TDD to test an app that relies mostly on database CRUD operations?
That's a nice thought, but I'd still have to deploy to the app server, AFAIK. That's a lot of the 3+ minutes. That said, it's definitely worth doing. But it's still difficult to imagine running the tests as often as I would run unit tests and therefore it seems inefficient to develop using TDD.
Jun
27
comment How can I use unit tests and TDD to test an app that relies mostly on database CRUD operations?
@JeroenVannevel OK what about the TDD aspect? Do I have to drop that? To me a 3+ minute feedback loop for TDD defeats the benefits.
Jun
27
comment How can I use unit tests and TDD to test an app that relies mostly on database CRUD operations?
@gnat ok I edited my question, thanks
Jun
27
comment How can I use unit tests and TDD to test an app that relies mostly on database CRUD operations?
@randomA correct, I edited my question to explicitly say that. I don't understand why you're recommending I change the question. Can you elaborate? I want to keep the unit test part in there because I'd rather be writing unit tests than integration tests (although I'm aware that unit testing != TDD)
Jun
11
comment What kind of code would Kent Beck avoid unit testing?
@Telastyn If you're saying, "Kent Beck could just reply to that other question (or that I could do it on his behalf if he replies)" I see your point.