2,067 reputation
924
bio website
location
age
visits member for 2 years, 1 month
seen 4 hours ago

4h
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.
Jun
11
comment What kind of code would Kent Beck avoid unit testing?
@Telastyn JoshKelley's answer shows otherwise, but that's your right. Besides, if Kent Beck replies to my email I'll be able to post it as an answer anyway. But I won't be able to do this is the issue is closed.
Jun
11
comment What kind of code would Kent Beck avoid unit testing?
FWIW, I don't come to your conclusion about many objects collaborating together. I think he advocates independence for test stability and reproducible results. In fact, to me it seems impossible to avoid "many objects collaborating together" unless you were stubbing/mocking.
Jun
11
comment What kind of code would Kent Beck avoid unit testing?
@MichaelT nope, I'll do that now though. Good idea. If he replies I'll post the answer here.
Jun
11
comment What kind of code would Kent Beck avoid unit testing?
@GlenH7 after skimming those answers I'm not satisfied (but of course, that's just my opinion). For example, look at UncleBob's answer. He doesn't even acknowledge that such a situation exists. I really think there's value in understanding Kent Beck's position, not just a general, "What's your opinion?" After all, he's the father of TDD.
Apr
29
comment What is the Loopback Pattern?
How is this different from a mock?
Mar
27
comment Should we test all our methods?
I'm still making up my mind on this question, but here's a talk of someone who has decided the answer is "no". Ian Cooper: TDD, where did it all go wrong To summarize this great talk, you should test outside-in and test new behaviors not new methods.
Mar
4
comment I'm struggling with abstracting my animation code in my game using a functional style. How can I do this?
It also seems to be against the design of the Entity Component System design pattern. That said... If you think I should still just put the function in my state, I'll trust you on this.
Mar
4
comment I'm struggling with abstracting my animation code in my game using a functional style. How can I do this?
I'm using javascript + "discipline" to code it in a functional style. I've also been trying to keep my data and behavior completely separate from each other, and I feel like the player state having-a function would be mixing the two together. My rule is somewhat arbitrary, but a nice benefit is I can easily serialize the state whenever I want to save it or have another programming language send it over the wire. That said, your answer is an easy way to accomplish the result I'm looking for. But, is there a way to do it while keeping behavior out of my state?
Mar
3
comment I'm struggling with abstracting my animation code in my game using a functional style. How can I do this?
What's a functor? Are you using the "Function Object" meaning of the word?
Jan
30
comment So Singletons are bad, then what?
@Lucas ah, so is he saying the impl of that Cache class uses those interfaces on the side but implements the interfaces below?
Jan
30
comment So Singletons are bad, then what?
@Lucas that didn't clarify. Maybe because of your typos.