One of the most exciting parts of my job is to go somewhere for the first time. And that is not every day I get to go to a brand "new" country to meet clients. So I was pretty much looking forward to visiting Vietnam this time around to deliver training.
Of course, this can sometimes be tricky. Vietnamese is not one of the languages I know, not even a bit (I did learn how to say thank you, but not sure if my pronunciation is any good). More on that later.
The first two days were spent on the training itself. A question came up that I had to answer a few times already: Any guidelines on how many files should be in a unit testing environment? So, here is my rule of thumb: you should have only the number of files necessary to write a single compound test.
To illustrate, let us take as an example a project with one hundred files. One compound spans functions in files A, B and C, while another compound runs through A and D. My rule of thumb would suggest that a maximum of three files should be present in any environment (with files A, B and C under test). There should also be another environment that includes A and D only.
Now, before you rush to judgment and tell me this is not efficient, keep in mind the difference between not stubbing a file (by either having VCAST compile it into the test harness or linking it from a library) and putting the same file under test. In the first case, you will usually get more code inside your environment than if you were to stub the extra files. But when you put the file under test, you are essentially telling VectorCAST you want it to prepare the test driver to test every single function in that file. Hence, code inflation takes place, because the driver grows to match the number of files under test. And that translates into:
- an inability to fit test environments into some targets with limited memory
- in extreme cases I saw a much longer compilation time than necessary, as the compiler and the linker have to deal with much more code
Then, consider what my rule of thumb does for you: you get to run all the tests you want, but you are dividing the work into multiple environments which individually will be far less complex and larger than a mega environment with several dozen files included. These environments need not be stubbed, which means that your code still gets executed. You can even provide code coverage on files that are being compiled in the test harness without being put under test (just go to Coverage->Initialize Custom), so you can still get code coverage for "compiled in" files if you wish to do so.
And, don't worry about reporting being more complex. If you have Manage/C++ Enterprise, all you need to do is create environments from your project, and as you build tests, code coverage gets automatically merged at a project level. Just take a look at the Files sub tab of the Management View. If you select all the files and right-click, you can even generate a mega-code coverage report. And of course, you then get access to the power of Change-Based Testing, or CBT. Don't know yet what CBT is? Please peruse our website or contact your friendly Vector Software representative, mate, because you are going to love what we have to tell you!
So, coming back to the trip... well, I got a few challenges to deal with. First, my cell phone plan apparently doesn't cover Vietnam very well (arch-expensive call rates and no Internet access), so I walked several kilometers to a shopping mall where I purchased a SIM card. To communicate with the people at the store, there was a good amount of hand talking (and then, they went on THEIR cell phone, typed translate.google.com and wrote what they wanted to tell me). That enabled me with the power of mobile Internet - including the all important map and translation web sites. I was set to explore Vietnam!
Second challenge: the food. My personal rule is to never eat at the hotel (too easy) and always local (whenever possible). It is possible to get food from pretty much anywhere in Hanoi, but most of the places are small shop affairs when they are not ephemeral on-the-street restaurants. Obviously, no menus, and where there was a menu it was in Vietnamese. The first night I got lucky - nice restaurant where I got succulent pork and salad - one of the employees knew some English, and then the cell phone was useful too.
Striking gold: delicious pork made in Vietnam
Second night, tried to go to another restaurant that seemed nice but I understood that being alone was not allowed in that joint (despite having plenty of empty tables...). So, I went to a more humble restaurant in a semi-open warehouse-like building that turned out to have no menu except the one on the wall. Employees looked nervous, so I wanted to order quickly. But how to do it? They brought me to their kitchen. I pointed to a few things, but they did not get it. Come back to "my" table (in fact, a long table with many people around). What should I do? Perhaps point to the neighbors' meat (it did look good) and ask for the same? Finally, typed on the cell phone pork kebabs and beer (which is easy to say in Vietnamese: bia!).
This is when I learned I just dodged a bullet. My neighbor knew some English and decided to engage in some basic conversation. He offered me whatever they were drinking (it was good, but strong) and then asked if I wanted to partake in the meal he had. No thanks, but... what is it? Dog meat. OK, alright, you got me mate. There are three things I won't touch, and that is one of them (the other two being stinking French cheese and stinking tofu).
Then, the third day was Saturday. Time to explore the city! I walked all the way from my hotel to downtown and back (28km in total). This is when I understood something else. The Chinese symbols for Hanoi literally mean "inside a river." Very good description of the weather there: it is so humid you feel you are swimming wherever you go! So, I made sure to stop frequently to get something to drink to replace the gallons of water my body was sweating in a vain attempt to keep me cool. But then, one of the machines I bought a drink from apparently wanted to prank me.
Help! I can't get to lifesaving ice tea!
The roads weren't exactly straightforward either. At some point, Google Maps had me engaged in a series of small roads layered like a maze where bikers were streaming along. Not too many people around though. Wondered why... For sure, it was not dangerous (as long as you paid attention to these bikes, but then Vietnamese drivers seem quite professional on two wheels).
Navigating the maze to explore Hanoi
My efforts paid off. I stopped at the Ho Chi Minh mausoleum, located right next to the presidential palace. Americans have the White House and South Koreans the Blue House, but I did not know Vietnam had a Yellow House (and a very nice one at that).
The Presidential Palace
Continuing the visit, I went around a small pond that used to be the decision-making power center for Vietnam, including this structure where Ho Chi Minh must have spent a lot of time. Upstairs were his apartments, and downstairs the meeting room. Yup, no walls, you preside over a ministerial conference outside. Nice!
Political discussions always more productive in nice surroundings.
Then, I went to the citadel where successive Vietnamese governments (such as the emperor and the Chinese governors that at one time administrated the land) have been ruling for over 1,300 years. It is now listed as a world heritage site. Some of the old buildings were destroyed by the French when they colonized Vietnam, leading to a merging of construction styles. And then, there was this long staircase down a bunker where the government ran its war affairs. You could see and sense the weight of history all around. It was also the only place with no air conditioning where I actually felt comfortable temperature-wise, being buried several feet underground.
The War Room
Stay tuned for Part 2 of my journey in the next blog post!