870 reputation
616
bio website
location
age
visits member for 4 years, 2 months
seen Sep 23 at 7:17

Jun
27
comment How should I test boolean function with many possible permutations
I usually test private methods with introspection, but this is a controversial topic. Have a look here: stackoverflow.com/questions/34571/…
Jun
27
comment How should I test boolean function with many possible permutations
So if you need to test the output of a method that takes 3 boolean parameters, you will test every possible combination ? And what if one of the parameters is a not boolean and the amount of possible combination explodes ?
Jun
27
comment How should I test boolean function with many possible permutations
a) this is an example; not real case; but often boolean expression are quite complex, even when reduced with intermediate steps: it' a bit like regular expression. b) I'm concerned when the test is more verbose and more complicated than the tested code: first it is a nightmare to maintain, and where are the tests for the tests then ?
Jun
27
comment How should I test boolean function with many possible permutations
Yes, refactoring is the natural way to go. By the way my example was awful on purpose: it's the kind of code I'll found in my 'back to future' project. But sometime the expression is not so simple to decompose, or it belongs in external codebase that is not tested... Another point is that intermediate methods should be private, hence they should no be unit tested; and the permutation issue would stay the same. I would also prefer to have intermediate variables than intermediate methods for small bit like this, especially if the class contains already many methods.
Jun
27
comment How should I test boolean function with many possible permutations
I started to consider this option after having some trouble to write tests for heavy boolean expression. I considered the refactoring approach as suggested by MainMa, but then I considered truth tables (and generator for the parameter combinations). I asked the question here because I wanted to have hints from others before going to deep in this solution.
Jan
26
comment Code maintenance: keeping a bad pattern when extending new code for being consistent, or not?
Hi Erik, sometimes a code that could have been factorized is more simpler to read: it is dozen of time the same thing and the code is straightforward. You can read it in a row without to think about it and you can debug in a linear way. There is no hidden complexity.
Nov
26
comment What is a good support knowledge base tool?
@Michael: your answer is a good one. I'm just looking to an alternative more tailored toward our goal. We are already using a solution quite close to the one you promote, but we feel some pain with it. The search is not helpful for our usage and I was just trying to discover what other people are using. A vast majority are using a wiki, fine. But maybe some are using other tools and are also happy. About the 'contains' search I was more talking about the fact that search engine like google are more aware of the context than a pure text based search...
Nov
26
comment What is a good support knowledge base tool?
We are using confluence and the search result are often not good for this kind of stuff: either too much pages are found or no page at all. It is also hard to browse all issues as a table for quick glances. Google is working with text, but I don't think they are using a simple 'contains' operation... I don't disagree about using a wiki: that what we are using now! It is much about having a proper tool to be more efficient. In a way I'm feeling being advised to use a wiki when I'm looking for something closer to a bug tracking system.
Nov
26
comment What is a good support knowledge base tool?
Hi Michael, we already have a wiki with WISIWYG, which is good and we are happy to use it for our regular documentation. But when it comes to organize and search across support resolution the it is useless... We need something really aimed for this kind of usecase.
Jul
30
comment How to ease the maintenance of event driven code?
@Giorgio, it is more or less the case (for my current problem): events can arrive in random events because the executed part is an async callback. And for the listeners/handlers they are usually registered as a well known sequence, but some extension can register their own handler. In this case the order of execution can be hard to determine without any prioritization system, and this can lead to some bugs.
Jul
30
comment How to ease the maintenance of event driven code?
Thanks for the link, it's a great answer.
Jul
17
comment How to ease the maintenance of event driven code?
@Emmad, this is an example and it is probably over engineered. But it has been 'designed' to solve another kind of maintenance problem. My question is more general: what are you doing when you have to deal with code that is using a lot the event driven paradigm. This kind of code can become very complicated, even in simple GUI. Some technology rely a lot on events outside GUIs, like Hibernate. I'm just trying to collect best practices and advices.
Jul
16
comment How to ease the maintenance of event driven code?
I have updated my question. You are totally right about sequence and async stuff. How would you handle a case where event X must executed after all the others event are processed ? It is looking like I have to create a more complex Handlers manager, but I also want to avoid to expose too much complexity to the users.
Jul
16
comment How to ease the maintenance of event driven code?
The need to post this message came from a refactoring when I moved from a inheritance hell to something based on event. On some point it is really better, but on some other it is quite bad... Since I've already had some trouble with 'events gone wild' in some GUI, I'm wondering what can be done to improve maintenance of such event sliced code.
Jul
16
comment How to ease the maintenance of event driven code?
Is their any alternative design to avoid the 'worse than the Spaghetti' ?
Jul
16
comment How to ease the maintenance of event driven code?
But if you have dozens of handlers attached to each state, you'll be not so fine when trying to understand what is going on... And every event based component may not be described as a state machine.
Jul
16
comment How to ease the maintenance of event driven code?
Yes, that's an helpful advise. The amount of produced logs can then be frightening (I can remember having some hard time to find the cause of a cycle in the event processing of a very complex form.)
Jul
16
comment How to ease the maintenance of event driven code?
@stijn, it is more a general question than a given case. When there is an event based component it tends to finish like I described it. So I'm looking for other tools and techniques.
Jul
16
comment How to ease the maintenance of event driven code?
@Telastyn, that's true, but sometime you have to consider order (just like when you are using filters on a servlet). If you are using events to decouple components (versus notification only), you will also have to do actual logic (even if indirectly)
Jul
16
comment How to ease the maintenance of event driven code?
@Thorbjoern: see my update.