Until recently, what I mostly knew about test-driven development was the concept of red-green-refactor, unit testing application code while building them from the bottom-up. Likewise, I also thought that mocking was only all about mocks, fakes, stubs, and spies, tools that assist us in faking integrations so we can focus on what we really need to test. Apparently there is so much more to TDD and mocks that many programmers do not put into use.
Justin Searls calls it discovery testing. It’s a practice that’s attempts to help us build carefully-designed features with focus, confidence, and mindfulness, in a top-down approach. It breaks feature stories down into smaller problems right from the very beginning and forces programmers to slow down a little bit, enough for them to be more thoughtful about the high-level design. It uses test doubles to guide the design, which shapes up a source tree of collaborators and logical leaf nodes as development go. It favors rewrites over refactors, and helps us become aware of nasty redundant coverage with our tests.
And it categorizes TDD as a soft skill, rather than a technical skill.
He talks about it in more depth in a series of videos, building Conway’s Game of Life (in Java) as a coding exercise. He’s also talked about how we are often using mocks the wrong way, and shared insight on how we can write programs better.
Discover testing is fascinating, and has a lot of great points going for it. I feel that it takes the concept of red-green-refactor further and drives long-term maintainable software right from the start. I want to be good at it eventually, and I know I’d initially have to practice it long enough to see how much actual impact it has.
I have always been a skinny dude. And I have always thought that I won’t change, that it’s just the way things are for me. But keeping the same diet and sedentary lifestyle for many years has taken its toll in recent years and, although I have not been sickly, my energy levels just did not feel the same as it has been when I was younger. I tire easily now than before, even when I don’t really go out much. Perhaps it’s just age doing its thing, like we are supposed to get tired faster as we get older. But it is a nagging feeling, it does not feel good at all, and is something that I decided I want to find a sustainable way of correcting this year if possible.
Reading Scott James’ ‘Bony to Brawny‘ book (and actually changing diet and exercise habits) is taking multiple steps forward towards that goal.
Some takeaways from the book:
- The funny thing is I have literally never regretted a workout – it just doesn’t happen. The release of endorphins and the feeling of knowing you’re making progress towards your goals while improving your health, mobility, and well-being is intense.
- If you’ve been skinny all your life, chances are you haven’t been eating much in terms of calories. When you’re entering a bulking phase, the amount of food may seem overwhelming. Focus on liquid nutrition. Consuming two shakes (depending on how many calories you incorporate) plus two solid meals will without a doubt place you in a the caloric range you need to be hitting to pack on some solid lean muscle mass.
- There is no food out there that’ll make you gain muscle at a quicker rate than another food. The food itself won’t build muscle – the calories and macro-nutrients it contains will. Try fish, chicken breast, eggs, cottage cheese, almonds, brown rice, milk, and sweet potatoes.
- Eating fat will not make you fat at all. Fat is essential for regulating hormones. Excess calories make you fat – not any particular macro-nutrient itself (protein, carbohydrates, or fat).
- For optimal performance in sports and resistance training, as well keeping your appetite in check, consumer at least 30% of your daily calories from protein, with the remaining 70% coming from a breakdown of carbs and fats. If you neglect your protein intake you will not be able to be able to build and retain lean muscle; if all you’re eating is carbohydrates and fat, you’ll be packing on the pounds in the form of stored body fat.
- In order to build that muscle mass and shred that fat, you need to create the demand for your body to do so. After ongoing demand, your body begins to adapt, and adaption is growth. This demand is solely created inside the gym – i.e. lifting heavy weights! An exercise regime based on compound movements will force your body to adapt – heavy squats, deadlifts, bench presses and overhead presses in the low rep range will create the demand far better than any isolation based workout regime based around light dumbbells or machines.
- Without a caloric surplus, you won’t pack on any muscle mass. At the same time, if lifting is neglected and dieting is honed in on to the utmost detail, you’re still on the road to fat gain as your body is not being forced to adapt and grow (using this caloric surplus to repair your body and build muscle)
- As a newcomer, you will find the demand is quite easy as your body has never experienced such stress before. However, as time goes on, you must apply progressive overload in order to keep the demand going. Increasing the weight you’re lifting, increasing the time your muscles are under tension, adding in a few additional reps – these techniques are designed to place an increased load on your muscles each and every workout. In essence, the demand must become greater and greater with each workout. When you’re demanding the same thing from your muscles week after week (same weight, same reps, same time under tension), the demand to go above and beyond has vanished, and so will your progression in terms of size and strength). The guys in the gym repping the same weight week in week out won’t get far. The guy adding that extra 2.5 lb plate to the barbell each workout will. It adds up over time.
- In order to get big you need to focus your energy on your heavy compound movements. Don’t major in minors, aka: spending your time floating around from isolation exercise to isolation exercise. This is a sure-fire way for a skinny guy to see sub-par size gains. Movements or exercise that do not give the muscles the required resistance, but are the kind that involve a great number of repetitions, never break down any tissue to speak of. These movements involve a forcing process that cause the blood to swell up the muscle, and simply pump them up. The insane, full, pumped feeling you get in your arms and chest when training is merely the increased blood flow tot the particular muscle group being worked. The pump does not equate to muscle growth.
- If you’re new to low rep training, it’s worth noting that you will not get the immense pumps you may be used to from performing high repetition training. As a general rule, most things that are satisfying in the short term aren’t beneficial at all in the long run.
- Once you are comfortably hitting the top end of the rep range, I recommend increasing the weight. You should be able to perform a minimum of four reps with the new weight. If you’re unable to perform four reps with correct form and range of motion, the weight is too heavy. Add 5 lbs/10 lbs to each dumbbell/barbell exercise once you are comfortably hitting the upper range of the prescribed repetitions.
- Each and every repetition should be controlled and timed. 2 seconds down – 1 second hold – 2 seconds up. If you’re performing your repetitions any faster than this, your muscles won’t be under tension for particularly long. To ensure you get the maximum bang for the buck in terms of size and strength, focus on the 2:1:2 tempo. Rest for 2-3 minutes between sets of heavy compound exercises. Rest for 1-2 minutes maximum between sets of isolation exercises.
- We don’t build muscle in the gym by banging and clanging around with heavy weights. We’re actually destroying our muscle fibers – which is telling our bodies that our current physique is insufficient. Resting after a workout and the nutrition components of your bulking phase are where the growth comes from. Lifting four times per week with adequate sleep and recovery will net you far greater results than training six times per week with minimal sleep and no downtime.
- Sleep plays a key role in the following bodily processes: regulation of glucose in the body, promoting good blood pressure, the perfect way to recover and repair damaged muscles, promoting hormonal functions and processes, promotion cognitive functions and processes. Your sleep should be within the 7-9 hour bracket per night, keeping in mind this is high quality, uninterrupted sleep.
- If you’re not making any size gains, this will be the result of one of two things:
- You’re not lifting heavy enough. In order to grow, we need to provide ongoing progressive overload during our workouts. Ensure you’re working in the prescribed rep ranges for your heavy compound exercises and give it your all. If you’re calling it quits on your set when it starts to feel uncomfortable, you’re not going to get too far.
- If you’re lifting regime is solid, then the issue is likely to be related to your diet, or most specifically the lack of calories you’re consuming. A failure to build muscle mass is most commonly due to an insufficient number of calories coming in. Re-calculate your total daily energy expenditure and apply a more aggressive caloric surplus if necessary.
- Pick a workout routine, follow it, eat well, and get adequate rest. Follow this consistently for six months. During the course of this time, track your weight, your body fat, your arm size, your chest size, how you feel after each workout, and from there you can reassess and make the necessary changes.
- When your progress slows down or completely stops, whether this be in strength gains, shedding that unwanted body fat or gaining muscle mass, it’s time to take a step back and look at what you’re actually doing. Doing the same thing over and over again while expecting a different outcome is the definition of insanity.
- Progress is the ultimate motivator. It’s the positive feedback loop of putting in effort, seeing results and therefore continuing to grind away day after day because you know what you’re doing is making a difference.
There are various levels of testing in software. The one most people are familiar with (including software testers) is testing done through the user interface, which is basically using the application at the end of a software development cycle and finding out whether it does what it is supposed to do. It’s a practice that is easy to understand and natural to do. Most of us have mobile devices or computers at home and in that sense we all understand how to test apps on the UI at some basic level. We explore the functionalities apps say they deliver and we decide for ourselves whether we think those promises are being kept or not. We feel good when everything works well or we feel bad when it is difficult to use the app (and maybe never use that app again). That said, software testing is not limited to the user interface.
The more experienced testers understand that testing is easier to perform and more valuable when it is done early in the software development process, making sure that we are doing the right things and are doing things right, even though we know we can’t test everything all at once. Bugs found before shipping are cheaper and easier to solve than bugs found later. Quick and early feedback is ideal. But to accomplish testing early in the software development process means that testers actually need to understand how software is built from code, not just the code itself and how various pieces of code integrate with one another but how programmers write code too. Like everyone else, programmers are people and human and are fallible. People make mistakes, and people can continue to make mistakes even if they work on projects carefully, because that’s how people and the things they build grow. That’s why testing needs to happen as early as possible. That means testers working alongside programmers in putting systems in place that tests the application simultaneously while it is still being written, even when there is no user interface to see yet. That means recognizing where and when mistakes happen, whether in code or habits or processes, and making it easy to spot them when they happen again. Testing in the user interface will never disappear but we can do better than restricting ourselves to just testing at the end.
“Tools of Titans” is Timothy Ferriss‘ latest book, compiling lessons he has learned from interviewing over 200 world-class performers in his ‘The Tim Ferriss Show’ podcast. It is massive, and the number of takeaways he’s given away in the book is as plenty as it’s size. Like his “The 4-Hour Workweek” title, several of the ideas in it got me thinking deeper into how I’m living my own life, asking myself which projects and goals actually matter. Plus there’s bonus notes on other interesting things, like physical exercises that provide bang for the buck and the profound effects of using psychedelics in healthy doses.
Some favorite lessons:
- The quality of your questions determines the quality of your life.
- Do your kids remember you for being the best dad? Not the dad who gave them everything, but will they be able to tell you anything one day? Will they able to call you out of the blue, any day, no matter what? Are you the first person they want to ask for advice?
- If you don’t do something well, don’t do it unless you want to spend the time to improve it.
- Accept that quality long-term results require quality long-term focus. No emotion. No drama. No beating yourself up over small bumps in the road. Learn to enjoy and appreciate the process. This is especially important because you are going to spend far more time on the actual journey than with those all too brief moments of triumph at the end.
- It’s not what you know, it’s what you do consistently.
- When you’re thinking of how to make your business bigger, it’s tempting to try to think all the big thoughts, the world-changing, massive-action plans. But please know that it’s often the tiny details that really thrill someone enough to make them tell all their friends about you.
- If this were the only thing I accomplished today, would I be satisfied with my day? Will moving this forward make all the other to-dos unimportant or easier to knock off later?
- You can sacrifice quality for a great story.
- People who have plenty of good ideas, if they’re telling you the truth, will say they have even more bad ideas. So the goal isn’t to get good ideas; the goal is to get bad ideas. Because once you get enough bad ideas, then some good ones have to show up.
- The way you teach your kids to solve interesting problems is to give them interesting problems to solve. And then, don’t criticize them when they fail. Because kids aren’t stupid. If they get in trouble every time they try to solve an interesting problem, they’ll just go back to getting an A by memorizing what’s in the textbook.
- Commit, within financial reason, to action instead of theory. Learn to confront the challenges of the real world, rather than resort to the protective womb of academia. You can control most of the risks, and you can’t imagine the rewards.
- Choose projects and habits that, even if they result in “failures” in the eyes of the outside world, give you transferable skills or relationships.
- For anything important, you don’t find time. It’s only real if it’s on the calendar.
- When deciding whether to commit to something, if I feel anything less than “Wow! That would be amazing! Absolutely! Hell yeah!”—then my answer is no. When you say no to most things, you leave room in your life to really throw yourself completely into that rare thing that makes you say, “HELL YEAH!”
- Great creative work isn’t possible if you’re trying to piece together 30 minutes here and 45 minutes there. Large, uninterrupted blocks of time—3 to 5 hours minimum—create the space needed to find and connect the dots. And one block per week isn’t enough. There has to be enough slack in the system for multi-day, CPU-intensive synthesis. For me, this means at least 3 to 4 mornings per week where I am in “maker” mode until at least 1 p.m.
- Don’t try to please anyone but yourself. The second you start doing it for an audience, you’ve lost the long game because creating something that is rewarding and sustainable over the long run requires, most of all, keeping yourself excited about it. Trying to predict what an audience will] be interested in and kind of pretzeling yourself to fit those expectations, you soon begin to begrudge it and become embittered—and it begins to show in the work. It always, always shows in the work when you resent it.
- You can’t blame your boss for not giving you the support you need. Plenty of people will say, ‘It’s my boss’s fault.’ No, it’s actually your fault because you haven’t educated him, you haven’t influenced him, you haven’t explained to him in a manner he understands why you need this support that you need. That’s extreme ownership. Own it all.
- The world is this continually unfolding set of possibilities and opportunities, and the tricky thing about life is, on the one hand having the courage to enter into things that are unfamiliar, but also having the wisdom to stop exploring when you’ve found something worth sticking around for. That is true of a place, of a person, of a vocation. Balancing those two things—the courage of exploring and the commitment to staying—and getting the ratio right is very hard.
- Any great idea that’s significant, that’s worth doing, for him, will last about 5 years, from the time he thinks of it, to the time he stops thinking about it. And if you think of it in terms of 5-year projects, you can count those off on a couple hands, even if you’re young.
- The way you do anything is the way you do everything.
- To blame someone for not understanding you fully is deeply unfair because, first of all, we don’t understand ourselves, and even if we do understand ourselves, we have such a hard time communicating ourselves to other people. Therefore, to be furious and enraged and bitter that people don’t get all of who we are is a really a cruel piece of immaturity.
- It’s better to be in an expanding world and not quite in exactly the right field, than to be in a contracting world where peoples’ worst behavior comes out.
- In any situation in life, you only have three options. You always have three options. You can change it, you can accept it, or you can leave it. What is not a good option is to sit around wishing you would change it but not changing it, wishing you would leave it but not leaving it, and not accepting it. It’s that struggle, that aversion, that is responsible for most of our misery.
- Perhaps I didn’t need to keep grinding and building? Perhaps I needed more time and mobility, not more income? This made me think that maybe, just maybe, I could afford to be happy and not just “successful.”
Timothy Ferriss‘ “The 4-Hour Workweek” might be my favorite book this year. Tons of lessons about how to be productive, as well as how to enjoy life to the fullest, and reading the book has left me excited about the future while reconsidering many of my other choices.
Some favorite takeaways:
- The perfect job is the one that takes the least time. The goal is to free time and automate income.
- ‘If only I had more money’ is the easiest way to postpone the intense self-examination and decision-making necessary to create a life of enjoyment – now and not later. Busy yourself with the routine of the money wheel, pretend it’s the fix-all, and you artfully create a constant distraction that prevents you from seeing just how pointless it is. Deep down, you know it’s all an illusion, but with everyone participating in the same game of make-believe, it’s easy to forget.
- What are you waiting for? If you cannot answer this without resorting to the previously rejected concept of good timing, the answer is simple: You’re afraid, just like the rest of the world. Measure the cost of inaction, realize the unlikelihood and repairability of most missteps, and develop the most important habit of those who excel, and enjoy doing so: action.
- Retirement as a goal or final redemption is flawed for at least three solid reasons:
- It is predicated on the assumption that you dislike what you are doing during the most physically capable years of your life.
- Most people will never be able to retire and maintain even a hotdogs-for-dinner standard of living. Even one million is chump change in a world where traditional retirement could span 30 years and inflation lowers your purchasing power 2-4% per year. The math doesn’t work.
- If the math doesn’t work, it means that you are one ambitious hardworking machine. If that’s the case, guess what? One week into retirement, you’ll be so damn bored that you’ll want to stick bicycle spokes in your eyes.
- If it isn’t going to devastate those around you, try it and then justify it. Get good at being a troublemaker and saying sorry when you really screw up. Ask for forgiveness, not permission.
- Ninety-nine percent of people in the world are convinced they are incapable of achieving great things, so they aim for the mediocre. The level of competition is thus fiercest for ‘realistic’ goals, paradoxically making them the most time- and energy-consuming. So do not overestimate the competition and underestimate yourself. You are better than you think.
- Doing something unimportant well does not make it important. Requiring a lot of time does not make a task important. What you do is infinitely more important than how you do it. Efficiency is still important, but is useless unless applied to the right things.
- Remember that most things make no difference. Being busy is a form of laziness – lazy thinking and indiscriminate action. Being overwhelmed is often as unproductive as doing nothing and is far more unpleasant. Being selective – doing less – is the path of the productive. Focus on the important few and ignore the rest.
- If you haven’t identified the mission-critical tasks and set aggressive start and end times for their completion, the unimportant becomes the important. Even if you know what’s critical, without deadlines that create focus, the minor tasks forced upon you (or invented) will swell to consume time until another bit of minutiae jumps in to replace it, leaving you at the end of the day with nothing accomplished.
- The key to having more time is doing less, and there are two paths to getting there, both of which should be used together:
- Define a short to-do list
- Define a not-to-do list
- Don’t ever arrive at the office or in front of your computer without a clear list of priorities. There should be no more than 2 mission-critical items to complete each day. Never. It just isn’t necessary if they’re actually high-impact.
We want performant, scalable, and quality software. We wish to build and test applications that our customers profess their love to and share to their friends.
- We have nonexistent to little unit, performance, API, and integration tests
- The organization do not closely monitor feature usage statistics
- Some of us do not exactly feel the pains our customers face
- We don’t have notifications for outdated dependencies, messy migration scripts, among other failures
- Some are not curious about understanding how the apps they test and own actually work
- We have not implemented continuous build tools
- It is a pain to setup local versions of our applications, even to our own programmers
- We do not write checks alongside development, we lack executable specifications
- Some still think that testing and development happen in silos
- It is difficult to get support for useful infrastructure, as well as recognition for good work
- Many are comfortable with the status quo
It seems that we usually have our expectations mismatched with our practices. We’re frequently eager to show off our projects but are in many instances less diligent in taking measures about baking quality in, and therefore we fail more often than not. What we need are short feedback loops, continuous monitoring, and improved developer productivity, ownership, and happiness. The difficult thing is, it all starts with better communication and culture.
It’s easy to learn something when you’re genuinely curious about it, no need to look for any other external motivation. On the other hand, it’s terribly difficult (often a waste of time) to teach something to someone who is not interested in the subject at that given point in time.
Software tester and programmer pairing in bug fixing or feature-writing situations is supposed to be a fun experience for both parties. Either of them getting frustrated at what they’re doing means something is blocking them from being able to perform well as a duo. Maybe they don’t know enough about the needs of the other person or how to fulfill those needs, maybe they don’t understand enough about the thing they’re building or how to build it in the first place.
If the people using the software have qualms regarding a feature update, maybe there happened to be a miscommunication between clients and developers about what feature the customers really want built. Solving that communication problem matters, maybe more than writing feature code quickly, definitely more than pointing fingers and blaming other people after the update’s been released.
Testing with deep understanding of why the application exists the way it is and how features actually work in both user interface and code helps us perform our testing more effectively, especially in situations with time constraints.
Pair testing happens more often than I initially thought it does, only not as explicit as how I imagine it happening.
For whatever you wish to be master of, it pays to have mentors, people you follow and respect and trust and provide feedback. If there aren’t any in your place of work, find them online.