Recent Forum Posts
From categories:
page »

Regarding your clarification on iterators - it is not entirely correct. With the proposed C structure you cannot have it in the several lists, because next and previous fields can make it part of only one list. So using iterators in C++ is still a viable alternative.

by sergii (guest), 10 Aug 2018 11:09
Martin Sustrik (guest) 25 Jul 2018 15:36
in discussion Hidden / Per page discussions » Unit Test Fetish

I don't write it. I inherit it from the past developers.

by Martin Sustrik (guest), 25 Jul 2018 15:36
Arcy (guest) 25 Jul 2018 06:31
in discussion Hidden / Per page discussions » Unit Test Fetish

I wonder how you write your codebase all at once. I allways start with one point. Your first codebase picture looks like a pot of color thrown on a canvas. Impressive but i smell the faults.

by Arcy (guest), 25 Jul 2018 06:31
Apostolis (guest) 15 Jul 2018 11:00
in discussion Hidden / Per page discussions » Inadequate Equilibria vs. Governance of the Commons

Let me clarify why we need the digital platform. It is not its use that is interesting but the evolutionary dynamics on institution rules that it creates.

It is same case with free software. Many use cases can be done by hand. The interesting thing with free software is our ability to replicate it, fork it and mutate it. It allows us to build very complex systems faster and at a lower cost.

What would happen if we made institutional rules free to replicate, fork and mutate?
The spcification language makes this possible. A common language with which all institutions are created.

by Apostolis (guest), 15 Jul 2018 11:00

In my opinion, while tools may be helpful, the real problem is elsewhere. In the end, people can just write the rules on a sheet of paper or on a simple webpage. But the problem of building the institution persists.

I would look at the existing institutions you consider "good" and try to find out how they were created. Maybe some common pattern will emerge.

As for me, one such interesting institution is IETF, because it deals with the problem that all Internet communities face (low cost of joining and thus incentives to misbehave), solves it in its own way and manages to survive for decades despite all the political interests involved. (And by the way, I am not aware of any political scientific treaty of IETF; it would be a nice PhD. thesis.)

To be more concrete, IETF has following features: Minimal cost of entry. Hierarchical organization with actual decision process delegated to the bottom, i.e. to the working groups. Decision by rough consensus. Focused and short-lived working groups. Proof of work ("show me the running code"). Regular in-person meetings.

by martin_sustrikmartin_sustrik, 15 Jul 2018 10:09
Apostolis (guest) 15 Jul 2018 08:51
in discussion Hidden / Per page discussions » Inadequate Equilibria vs. Governance of the Commons

If we look at institutions as a set of rules for the interactions of agents and communication as the means of coordination, then digital social platforms can be used to create those institutions.
Moreover, Facebook ,youtube , twitter etc. Can be considered as institutions that alter the behavior of participants (to keep them watching more ads).

How can we help agents build digital institutions that will serve their specific local needs?

First of all, as Ostrom says, each platform needs to support different rules of interaction.
Secondly, we need to enable participants to change the rules, thus the digital platform that enables the institution.

I have been trying to solve those 2 questions for many years. it seems that we need a specification language for multi-agent communication patterns. Currently i am looking at Lambort's TLA+ language and whether it can be used to enable the above institutions.

by Apostolis (guest), 15 Jul 2018 08:51

I completely agree that e2e tests and unit tests are complementary. However, what I am seeing over and over again in the real world is that existence of extensive set of unit tests is used as an excuse for not having e2e tests at all.

As for 3, I don't really understand the argument. The test and the code must interact via some kind of API. When they do, the API can't be changed without changing the test. That in turn incentivizes the developers to keep the API as is. Where's a flaw in that argument?

by martin_sustrikmartin_sustrik, 14 Jul 2018 06:01
Mat (guest) 13 Jul 2018 09:26
in discussion Hidden / Per page discussions » Unit Test Fetish

I’m sorry but I disagree with almost everything in this article. I think unit testing has become a kind of “cargo cult” programming in many places, which has led to people mindlessly implementing tests without understanding why they are doing it or what benefits they bring and this has understandably led to a backlash. However, this is an argument for education around it, not an argument for dumping it.

To address you points directly:

1) As people have noted it’s not a mutually incompatible thing. E2E tests do give a lot of help by covering many areas. However, they also give very little help in determining the problem. If something in the big black blob fails then you now have to track down exactly what the problem is. If something in the tiny black circle fails, that’s pretty easy to do. Additionally the limited scope allows unit tests to be run constantly, giving almost instant feedback during development, which can be very useful.

2) As above, this is a good example of why E2E and unit tests are complementary. Unit tests really ought to be testing the critical path as well as the edge cases though.

3) Only if you design them badly. I’ve seen far too many unimaginative solutions where there is a 1:1 mapping of test classes to actual classes. Nowhere is it written that this is how it must be. I usually start out this way, but during the “Refactor” stage of Red-Green-Refactor, I often start splitting classes out and moving things around. A test class really ought to test a subset of related cases, not a specific class, otherwise I agree that you are tightly coupling them. See for Uncle Bob’s take on this. Also worth noting that your argument holds for all consumers of an API (tests being one such consumer). You could also argue that any production code using your API also ossifies it, which is true to an extent, but is not a good reason not to write production code using it!

4) There indeed are things that can’t be unit tested (e.g. GUIs), which is why they are just one part of a good testing strategy… but your example is not one of them. When you write the test, you are not (just) checking that your 123 has not been changed to 124, you’re also checking that it’s been put in the right place. Imagine if somebody went in and changed that line to “int ttl = packet[7];”. Having a unit test in place would catch that mistake. This is where unit tests’ role as living documentation of requirements shines. Documents can go out of date, but using unit tests to document your expectations cannot do this: if you change the code it’s easy to forget to change the documentation, but impossible to forget to change the unit tests since it will fail the build otherwise.

5) As mentioned above, GUIs are something that probably fall outside of the “can be unit tested” sphere, however the point is still a straw man argument. If I were able to write a unit test for a GUI, it wouldn’t be “Test that this GUI looks good” but rather something like “Test that hovering over here, displays X”, “Test that that hyperlink points to Y”, or “Test that button Z is at least AxB pixels when the screen size is Q”. So you’re quite right that “some stuff has no rigorous acceptance cirteria”, but there’s a lot more that does in most places.

6) Very true, and I’ve seen this happen a lot… However, because something can be abused does not make it bad. The same can be said for many other things too, including E2E tests (I mean your first point was all about how E2E tests give better coverage!), and that is not a good reason not to use them. I suspect you were being tongue-in-cheek, but doing a terrible job to avoid this happening is the one thing that is DEFINITELY not a good idea!

7) Fair point – I’ve never implemented a red-black tree. However, as I think I’ve shown above unit tests really do have a place outside of this!

Regarding the point on E2E tests vs unit tests, I’ve heard it said that we shouldn’t be talking about tests in terms of “Unit”, “Integration”, “E2E”, etc., but rather just in terms of “Fast” (simple to create, run in isolation, and can run in real-time during development) and “Slow”. I have some sympathy with this position: I don’t think it covers a lot of the important nuances and so is not a good description by itself, but it helps to highlight some of the benefits of unit testing e.g. the real-time feedback, the ability to write them in sympathy with your main dev work (i.e. TDD), etc..

by Mat (guest), 13 Jul 2018 09:26

That's exactly the point. The architecture is poorly done and so you want to change it. However, that would mean fixing the unit tests. The more of them there are the less appealing the prospect of refactoring becomes. In the end you'll just decide to spare yourself all the work and go on with the existing broken architecture.

by martin_sustrikmartin_sustrik, 01 Jul 2018 17:12
Arun (guest) 01 Jul 2018 12:35
in discussion Hidden / Per page discussions » Unit Test Fetish

"architecture is that what makes software able to change"

As long as the change to implies extension, yes. But, why would unit test prevent change in those cases? I may not be seeing what you are conveying, a few concrete example would help. You do provide one - on components A, B and C. My take on that is, the architecture is poorly done, failing in due diligence with a long term vision.

by Arun (guest), 01 Jul 2018 12:35
by martin_sustrikmartin_sustrik, 14 May 2018 06:33

there is an english original, written 8 years before the Russian version was re-written by the author. and the title of that English original is "Everything was forever until it was no more" (Princeton university press, 2006)

by Alexei YurchakAlexei Yurchak, 13 May 2018 09:18

there is an english original, written 8 years before the Russian version was re-written by the author. and the title of that English original is "Everything was forever until it was no more" (Princeton university press, 2006)

by Alexei YurchakAlexei Yurchak, 13 May 2018 09:18

No problem, I read Russian, I'll put that on my reading list.

There are two thoughs I have though:

First, most of the population is indifferent in any system, in communist as well as capitalism. What makes difference is the engaged population and the common knowledge they have. From what I read it takes about 2-3% of the population to instigate a regime change. The numbers, as you can imagine, are just rough estimates.

Second, it may have been that the general attitude in Czechoslovakia was different than in Russia. For one, there have been the first (democratic) Czechoslovak republic between the wars which may have make some effect on the general attitude. For two, nobody was really happy about the invasion in 1968 and so people were, maybe, more likely to apply terms as "good" or "bad" to the regime. When I have a chance to speak to Russian people I often ask whether any information about Stalin's purges were passed down in their family. The answer is always: "No. My grandma never spoke about that." That may have been a little different in our parts.

by martin_sustrikmartin_sustrik, 12 May 2018 11:38

Most of soviet people did not see the situation as "soviets are bad" or "soviets are good", even apparatchiks (only the tiny minority evaluated the government on the good/bad scale). Most of them were in the camp "soviets are boring, we have more interesting things to do right now". Spreading the information was not a huge problem, making it relevant to the population was.

Check out "It was forever until it was over" by Yurchak (not sure if there is an English translation though), the Russian title is Алексей Юрчак "Это было навсегда, пока не кончилось".

by dottedmagdottedmag, 12 May 2018 11:19
Awn (guest) 12 May 2018 10:52
in discussion Hidden / Per page discussions » Research: Rescuers during the Holocaust

Recurrent and complementary moral decisions based on personal resolution of congnitive dissonance. That's quite an insight.

by Awn (guest), 12 May 2018 10:52
Tom Johnson (guest) 01 May 2018 18:02
in discussion Hidden / Per page discussions » Structured Concurrency in High-level Languages

Nice animation. Thanks.

Your concept of a bundle appears to be an interesting abstraction above a Dart isolate.

All Dart code runs in isolates, which is essentially is a thread with a separated-out heap and communication exclusively via message-passing (like Erlang Actors but seemingly without network transparency). From the main Dart isolate it is possible to create one or more new isolates to implement parallel code. Within one isolate it is possible to create tasks (single threaded concurrency) or use the async/await construct. First-class functions allow isolate-pools to be created. If you do a google search for "load_balancer.dart" you will find an interesting example of an experimental load_balancer that can run a function on multiple isolates in parallel based on some quantifiable load estimation.

There is lots more there. A parent isolate can be notified of child isolate errors. If you are targeting the DartVM and use spawn to create child isolates, you can pass objects back and forth. If targeting Javascript then only primitives (or maps or lists of primitives) can be passed.

My interest is soft real-time applications.

by Tom Johnson (guest), 01 May 2018 18:02

I am not familiar with Dart, but from quick research it looks like it has only the standard async/await construct. Am I missing anything?

by martin_sustrikmartin_sustrik, 01 May 2018 05:22
Tom Johnson (guest) 30 Apr 2018 19:20
in discussion Hidden / Per page discussions » Structured Concurrency in High-level Languages

How is this different than Dart's async calls?

by Tom Johnson (guest), 30 Apr 2018 19:20

I'll give them a look. Thanks!

by martin_sustrikmartin_sustrik, 30 Apr 2018 04:51
page »
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License