Tdd with C++ and Boost 42

Posted by Brett Schuchert Tue, 24 Mar 2009 03:28:00 GMT

I’m going to give Boost another whirl. There appears to be a great installer for Visual Studio. It requires free registration. I’m on the fence about what to use first and was wondering if you have any suggestions.

I’m thinking about basic things initially:
  • Regex
  • Threading
  • Sockets

Maybe a multi-threaded server responding to message via socket, with client threads processing requests using regex?

If you have anything you’d like to see, reply to this blog and I’ll follow up with you.

Comments

Leave a response

  1. Avatar
    james_ladd@hotmail.com about 4 hours later:

    If a server is what you are writing, then Id be interested in assisting/participating/helping. Rgs, James.

  2. Avatar
    Remko Tronçon about 5 hours later:

    I recently started using Boost quite heavily (also TDD, also networking), and it makes a lot of things so much easier, cleaner, and more correct (I’m one of those un-hip people that likes everything statically checked, even though I use TDD). And all this comes at virtually no price; you can even cut the external dependency on Boost by cherrypicking the necessary sources into your project. The only price you have to pay is the horrible, horrible error messages, and the gigantic backtraces (at least with signals). Luckily, after a while, you learn to ignore these huge blobs of nonsense.

    I also like the functional programming styles you can get with Boost.Bind and Boost.Lambda (superseded by Phoenix), although I still haven’t got the hang of the syntax of the lambda expressions completely yet; hopefully, C++0x will help on that front.

    The libraries I regularly use are: shared_ptr, Signals, Bind, BOOST_FOREACH (typedeffed as ‘foreach’), filesystem, noncopyable, numeric/conversion/cast, lexical_cast, Thread, and Asio. The list keeps growing though ;-)

  3. Avatar
    piyo about 8 hours later:

    Alex Ott posted a “How to write simple HTTP proxy with Boost.Asio”, which is a pretty good introduction to networking the Boost Asio way. http://xtalk.msk.su/~ott/en/cpp/BoostAsioProxy.html

    Since you sound like you’re on Windows, may I suggest having an alternative compiler with Boost pre-installed to give you a “second opinion” on Boost behavior:

    MinGW Distro – nuwen.net http://nuwen.net/mingw.html

    This is a package created by Mr. STL, a “Microsoft Visual C++ Libraries Developer”, so it’s Microsoft friendly.

  4. Avatar
    Keith Nicholas about 19 hours later:

    if you are going to TDD in C+, consider using GTest (google test ). I find it the better of all the TDD frameworks for C+.

    and boost is simply awesome :)

  5. Avatar
    Keith Nicholas about 19 hours later:

    not quite sure why you need the installer? just get the source and build it? the instructions are pretty straightforward, hooking it into Visual Studio is trivial.

  6. Avatar
    Brett L. Schuchert about 23 hours later:

    Keith Nicholas wrote:

    I really like google test, it’s really nice how writing a test fixture is just writing a class, very clean. I switched back from google test (after getting several projects ready for my students) because it did not provide memory leak detection.

    Other than that one thing, google test is better in most respects. However, memory leak detection is important enough feature that I decided to stick with CppUTest.

    I have a workspace with all of my projects running in google test and one with CppUTest. The google tests look better.

    Have you used boost test?

  7. Avatar
    Remko Tronçon 1 day later:

    Brett,

    For leak detection, I always use Valgrind on my test runners, which not only does leak detection, but also helps in finding any other types of memory errors. Unfortunately, Valgrind doesn’t work on Windows, and I suppose switching to tools like Purify is too expensive. I must say I didn’t know about CppUnit’s leak detection capability.

    I used Boost test briefly, but didn’t like it at all. Same goes for Boost.Build. I think the Boost tools are tailored to the Boost project’s needs, and are not generally useful.

  8. Avatar
    Brett L. Schuchert 2 days later:

    Well I quickly used the for each, io steam and briefly the lambda libraries. It’s pretty snappy to use the first two. I think I get the lambda library, but the examples are not complete and do not work for less than obvious reasons.

  9. Avatar
    Martin Jul 4 days later:

    One of the fascinating aspects that would be interesting to explore is the compile-time functional metaprogramming via templates that is the basis for all this. It is a much stronger template concept than in later languages like C#.

  10. Avatar
    Brett L. Schuchert 7 days later:

    Martin Jul wrote:

    One of the fascinating aspects that would be interesting to explore is the compile-time functional metaprogramming via templates…

    C++ templates are wicked cool and powerful. I remember sitting in the presenters’ lounge at SD West 2007 and someone was talking about “debugging the template generation in the compiler” and it was none other than Scott Meyers.

    I love the power of templates. And as much as you might think C# is weaker that C++, by compairson Java barely even registers a heartbeat! That’s why I’m of the opinion that the Java language is basically dead (like VB or COBOL are dead). No blocks in Java 7, generics support very weak. C# the language eclipsed Java some time ago and Java is now in the dead or dying category.

    Luckily, the JVM is alive and thriving. So really, I can get blocks through Groovy or JRuby. Even so, the language is weak, but I’m way off topic.

    I really stopped using C++ in 1997. Template meta programming was happening (thanks to AS and ML for the STL!), though it is much more sophisticated now that it was then. I could not really do it now without a lot of work.

    Also, now, much more than in 1997, I’m a big fan of testability. Since the compiler is already so complex, I don’t think we’re going to get hooks into its inner workings, making investigation much more difficult.

    Interesting? Very. Hard as hell? Yes.

    If I were to start this, however, I’d look at GCC. I bet there’d be ways to crack open its inner workings.

  11. Avatar
    Christopher Harris 8 months later:

    Boost’s shared_ptr alone was enough for me to bring it in, and it worked nicely with Visual Studio. This was a year and a half ago, and if I knew now what I know about TDD, unit testing, design patterns, I probably would have made even greater use of it.

  12. Avatar
    DVD to HTC about 1 year later:

    thanks,the post is really good PDF to BMP Converter will give you the satisfied

    output quality and conversion speed. Whether you are professional or novice, you can apply it without any errors. You can even set

    the personalized output effect

  13. Avatar
    bag manufacturer about 1 year later:

    here appears to be a great installer for Visual Studio. It requires free registratio

  14. Avatar
    AAAAAA about 1 year later:

    heir Concord Saratoga their attempts to

  15. Avatar
    Pandora about 1 year later:

    While reading through the second bdd example I realized that this was not intended, but distracted me while reading the first one a bit.

  16. Avatar
    iPhone contacts backup about 1 year later:

    we can do much more better.

  17. Avatar
    http://www.whiteiphone4transformer.com about 1 year later:

    Is white iphone 4 available right now? Cuz my friend told me he just got the white iphone 4 panel. But i haven’s seen it sold in my area. What’s wrong?

  18. Avatar
    iPhone SMS to Mac Backup about 1 year later:

    Thanks for shareing! I agree with you. The artical improve me so much! I will come here frequently. Would you like to banckup iphone SMS to mac, macBook, macbookPro as .txt files? Now a software iphone SMS to Mac Backup can help you to realize it.

  19. Avatar
    iPad ePub Transfer for Mac about 1 year later:

    I really like this essay. Thank you for writing it so seriously. I want to recommend it for my friends strongly. iPad ePub Transfer for Mac is a Professional transfer that can transfer the ePub books onto your iPad on Mac and export the iPad ePub to Mac local folder.

  20. Avatar
    Craig Spears over 2 years later:

    I like this post. A really good one. Thanks guys. roofing englewood

  21. Avatar
    okey oyunu oyna over 2 years later:

    good

    internette görüntülü olarak okey oyunu oyna, gerçek kisilerle tanis, turnuva heyecanini yasa.

  22. Avatar
    estate marketing over 2 years later:

    I really love your blog

  23. Avatar
    estate advertising over 2 years later:

    I always read your article and I love it :-)

  24. Avatar
    handbags for sale over 2 years later:

    THIS IS AWESOME! THANKS

  25. Avatar
    christian louboutin shoes on sale over 2 years later:

    Here have the most complete kinds of christian louboutin leather platform pumps.

  26. Avatar
    beats by dr dre headphones over 2 years later:

    The article is dull.

  27. Avatar
    cookies gift baskets over 2 years later:

    it needs a bokmark so i can come back to it later ,nice stuff

  28. Avatar
    beats by dre store over 2 years later:

    macBook, macbookPro as .txt files? Now a software iphone SMS to Mac Backup can help you to realize it.high quality headphones new design headphones

  29. Avatar
    robert.robot369@gmail.com over 3 years later:

    The website is providing the excellent info is visible in this blog. Thank you very much for providing the great technology in this blog Coroner Job Description|Medical Technologist Job Description|Corrections Officer Job Description|Financial Analyst Job Description

  30. Avatar
    how to become over 3 years later:

    I am very How To Become A Police Officer In Florida much How To Become A Dental Assistant satisfied How To Become A Personal Trainer by the amazing How To Become A Model info is visible in this How To Become A Sex Therapist

  31. Avatar
    how to become over 3 years later:

    blog and using the wonderful technology is visible in this blog How To Become A Cosmetologist This is really great technology How To Become A Car Dealer is visible in How To Become An Interior Designer this blog and sharing How Can I Become Famous the nice services in this blog How To Become A Notary In PA I had really impressed with

  32. Avatar
    how to become over 3 years later:

    How To Become A BETTER WRITER the nice info How To Become A Translator is visible in How To Become Prosecutor this blog and How To Become A Property Manager sharing the nice How To Become A Bartender technology in this blog. Thanks a lot for providing the nice info in this blog

  33. Avatar
    ysbearing over 3 years later:

    Slewing bearing called slewing ring bearings, is a comprehensive load to bear a large bearing, can bear large axial, radial load and overturning moment.

  34. Avatar
    Tips For Bowling over 3 years later:

    And the Marshall Plan, to us, meant a general who had turned into a secretary of state, and that the secretary of state saw the necessity of the reconstruction of these European countries that had suffered so heavily. Giovanni Agnelli

  35. Avatar
    alwadifa over 3 years later:

    I liked you blog so im going bookmark it with my prefered websites, you have posted an amazing posts so thank you I liked you blog so im going bookmark it with my prefered websites, you have posted an amazing posts so thank you

  36. Avatar
    christian louboutin over 3 years later:

    The professional design make you foot more comfortable. Even more tantalizing,this pattern make your legs look as long as you can,it will make you looked more attractive.Moveover,it has reasonable price.If you are a popular woman,do not miss it.

    Technical details of Christian Louboutin Velours Scrunch Suede Boots Coffee:

    Color: Coffee
    Material: Suede
    4(100mm) heel
    Signature red sole x

    Fashion, delicate, luxurious Christian louboutins shoes on sale, one of its series is Christian Louboutin Tall Boots, is urbanism collocation. This Christian louboutins shoes design makes people new and refreshing. Red soles shoes is personality, your charm will be wonderful performance.

  37. Avatar
    bladeless fans over 3 years later:

    Tdd with C++ and Boost 36 good post22

  38. Avatar
    louboutin sales over 3 years later:

    Tdd with C++ and Boost 37 hoo,good article!!I like the post!121

  39. Avatar
    swarovski gems wholesale over 3 years later:

    The world is a colourful place – shades of red, swarovski gems wholesale orange, blue and every other hue and tone in the swarovski crystal rainbow. But you might be looking for a change swarovski angelic earrings when it comes to your clothing colors. Why not pink brooch try black and white? Before you make up your mind that black and white is boring, read on!

  40. Avatar
    xutingting over 3 years later:

    It automatically switches off any music that was playing. You are going to apprehend your alarm by means of the headphones, and youll be heard by way of the congenital mic.For the a lot of portion, onster Beats headphones?beats by dre for sale. was amidst by dr dre beats cheap contest of all sorts . they’re your greatest option. you will so blessed to accept our solution.crrently they accept turn into added and added fashionable.In the level of beats for low-cost architecture aesthetics is really a affection for emotion-stirring music. the centermost chills and greater goose bumps appear if it feels like the musicians are in the allowance with you.the truest agreeable adventures appear if the adviser hears bose headphones canada single detail and dash accurately Monster Beats By Dre Canada definitely how the artists meant them to be heard.inexpensive beats by dre. Its due to this affecting acknowledgment that that Monster strives to achieve the achieved overall performance, a lot of authentic headphones offered.All cyberbanking food as able-bodied as accouterment food decidedly the bunched ones accept to accumulate this in thoughts,young Beats By Dr Dre NBA,people charge to feel as abstraction they currently accept what you are affairs accomplishing this you activate the coercion to purchase. Humans will not be as motivated to obtain factors as abundant as they accept an congenital abhorrence of accident them for that reason In case you Heartbeats Dr Dre 2.0 White,own an cyberbanking accumulate you ABSOLUTLY Should Beats By Dr Dre Pro Blue,beats by monster headphones added corpuscle phones on affectation to monster beats sale that humans can blow them with their buck hands. The aforementioned goes for any accouterment industry. If I will not be able to see the Studio dre beats Lover,clothing on a present mannequin once again I don’t accept absolutely what I am buying. Studio Monster Beats,If I may possibly possibly really feel the artefact I may be acquainted of it.

  41. Avatar
    cosplay 2012 over 3 years later:

    http://www.outfitscosplay.com/cosplay-catalog/fate-stay-night-cosplay Deluxe Fate/Stay Night Cosplay Costumes for Sale.Find your favorite characters and cosplay outfits from all the popular anime and games.

  42. Avatar
    Plastic Injection Mold over 3 years later:

    With more than 20 years of experience, Intertech provides an extensive integrated operational ability from design to production of molds 100% made in Taiwan. Additional to our own mold making factory, we also cooperate with our team vendors to form a very strong working force in Taiwan.

    For the overseas market, we work very closely with local representatives in order to take care of the technical communication and after-sales service to our customers. We also participate in the EUROMOLD & FAKUMA exhibitions and meet our customers every year in Europe. By concentrating on mold “niche markets”, we play a very useful mold maker role from the Far East whenever customers want to develop their new projects. We provide services from A to Z to our customers on a very economic cost and effect basis.

Comments