[–] 3 points 2 weeks ago

If unit tests are being done, some kind of emulator is usually what gets used and the scope of testing is significantly limited.

The more common approach is to abandon unit tests all together and go for board functional tests where as many of the external interfaces are controlled and put through representative loads. The complexity of the software is rarely that high so we can be pretty confident that we're covering everything we need to care about anyways.

  • source
  • parent
  • context
  • [–] 1 point 2 weeks ago (2 children)

    There's a couple big reasons, sometimes you only have to deal with one or two, other times you're hit with all of them.

    The data source for the algorithms often comes from arbitrary memory addresses that live outside the context of the C, C++, or Rust runtime. If I want to read CPU core temp I send magic numbers to one address to configure ADC channel conversion, another magic number somewhere else to do the conversion, wait a few dozen microseconds, then read a third new address that I squint one eye, spin around 10 times, and do a handstand and I'll get a number that looks like temperature.

    If I'm running on the microcontroller, I'm essentially in production environment and I can't control what the data is. If I recompile for a different system (say x86 Linux) then I'm almost certainly going to segfault. I could abstract out the reading of the data, but then on my tiny 8MHz microcontroller that has to run it's main loop at 1000Hz, I only have a few thousand clock cycles to get everything done, calling functions, pushing/popping the stack takes a lot of time.

    Adding to the pile-on most microcontrollers have <1MB of RAM, many in the tens of kilobytes range so I don't have much of a stack to work with and I need to keep even the number of instructions down.

    Even if you do all the abstractions, you then have extra logic you have to write to simulate what is happening and subtle behaviors that are timing dependant. It frequently is extremely difficult to do that as the documentation rarely fully describes everything, so you can lull yourself into a false sense of security that you've tested the code and it's correct, but then you get stuck on a register value that never changes and a watchdog timer comes along and resets the hardware on you.

    And that's not the getting into the runtime or build environments, flashing procedures, limited flash cycles, and a million other business constraints that technically you can do it, but at that point your dev team has all taken the month off to go play Half Life 3

  • source
  • parent
  • context
  • [–] 3 points 2 weeks ago (4 children)

    I guess I don't really count skimming as reading haha

    When looking for readability, maintainability, etc what I mainly look for are design patterns. If you're using the same boilerplate and layout I'm going to start skipping over sections

    I also mainly work on high performance embedded systems that are difficult/nearly impossible to unit test and I dont always have line coverage metrics. A lot more verification by inspection in my corner of the world

  • source
  • parent
  • context
  • [–] 6 points 2 weeks ago

    I'd argue that Monte Carlo is a bad example here, and is an example of a deterministic tool.

    You use a tool to create an outcome, you're looking for an answer or a solution that you can trust.

    If you want to examine behavior of a system that has input variables across some known range, you could brute force it, try every single possible combination and wait a millennia. Or you use a monte carlo strategy, let randomness enter the simulation to build out a basic characterization. You want more detail? More confidence? Increase the number of runs. I can trust that if I increase the number of runs I gain higher fidelity, if the tool/strategy was non deterministic I couldn't do that

  • source
  • parent
  • context
  • [–] 8 points 2 weeks ago (6 children)

    Not parent commenter, but no, not to the same degree.

    The level of trust I have in a source greatly changes how I review it. If I know that I'm reviewing code from a competent developer, I'm going to see a for loop and look for why is this here, how does it play into the larger objective and if I'm happy with it, I move on. But if I don't trust the developer as much, I'm looking at far more like what data type is being used in the indexing, what's the break condition, can go off the rails into random memory.

  • source
  • parent
  • context
  • [–] 4 points 1 month ago* (last edited 1 month ago)

    Relatable I don't think is the right word. Intuitive in its use and measurement, in specific scenarios.

    Measurements always have a scaling and a precision problem. Humans are bad at math and scale, and really struggle mentally with numbers more than a few digits. If the number is too big, someone will either just accept it or ignore it. We like our nice round numbers, and funnily enough like our small prime numbers (1, 2, 3, and 5) and first few multiples of primes (4, 6, 10, 12, 15, 20) and numbers that just shift the decimal point around (10, 100, 1000)

    Reference frames are also incredibly useful to us, especially when communicating.

    The metric system jumps straight to moving the decimal place around, where imperial let's you play around with other divisors. Let's say I have a single digit of some unit and I want to half it. Generally in metric this is fine, doesn't really add to the mental cognitive load. Half it again, or divide by one of the other primes, and the number of digits starts to explode (or is infinitely repeating). For the scalers within the imperial system, they naturally let you divide down and even re-express the same measurement in a different unit with fewer integer numbers and no precision loss

    Edit: Another example. Computer scientist don't use metric, we bastardized parts of it and then invented extra units that fit the need and intuitiveness of working with them. We don't use deci/deca or centi/centa, we bastardized kilo into 2^10 since 1024 is close to a thousand keeping it a nice power of two, a byte is 8 bits for the same reason and a nibble is 4 bits because halving bytes occasionally is useful. A word typically is 16 except when it is 32 bits, in which case 16 is a half word. Then we have dwords and qwords being twice and four times the size of a words, and then a page historically has been 4096 bytes since 1024 is kinda small, but newer systems sometime say a page is 64KB since 2^16 = 65536

  • source
  • parent
  • context
  • [–] 2 points 1 month ago

    Exactly

    There were some strong criticisms of NCLB when it was first created that correctly predicted this would happen.

    Another unintended consequence was the death of elective classes in all but the most affluent schools. Schools strapped for cash needed the extra money offered by NCLB so they diverted what little resources they had into classes that were measured through standardized testing. Shop, agriculture, civics, home economics, classes that actually helped students live a good life were axed in favor of more math and science since students generally performed lower in those subjects and were dragging scores, thereby funding, down

  • source
  • parent
  • context
  • [–] 15 points 1 month ago (3 children)

    I'm not an educator, but most of my family is and no child left behind is an interest of my sister who is a teacher, and it goes like this:

    School funding is heavily driven by tax revenue of the surrounding areas, so more affluent districts could afford higher pay, more expensive materials, etc than a less wealthy district. This meant the quality of education varied wildly across state to state, city to city, district to district. The subjects taught and the full scope of each subject being taught was different as well. So you'd end up with entire groups of children not having been taught things needed to be a productive member of society

    No Child Left Behind sought to correct this.

    The idea was to create a standardized set of knowledge expectations across the US and used additional funding as a corrective function to underperforming schools. If a school was doing well by their students they got more money, if a school was not providing as good of an education, they'd lose money. Doing "well" was primarily measured by checking the students' knowledge of the listed standard topics.

    In practice what happened was standardized test scores got mathematically tied school funding. Average grades, number of students graduated, a few other metrics also got tied mathematically to funding.

    School districts could try their best, provide the best quality education possible, and then hope and pray that the students performed well... Or they could cook the books and change internal standards to ensure that by all the measured metrics they got the most funding they could

  • source
  • parent
  • context
  • [–] 11 points 1 month ago (5 children)

    Sounds like someone wanted to avoid needing to recompile for the target, but was either hardware constrained on what they wanted to do or as they thought that implementing their own language was going to be easy, learned it's very much so not, and then took some stupid shortcuts

    I totally haven't done that myself, nope....

  • source
  • parent
  • context
  • [–] 5 points 2 months ago (1 child)

    That is the gamble with useful idiots though, sometimes they can surprise you.

    I think the Republican party is getting increasingly concerned that what little control and manipulation they had on him is fading fast.

    I also think they need to have someone who thinks they're in charge so they can project bravado and power to the undereducated base that is MAGA. No "strongman", no MAGA

  • source
  • parent
  • context
  • [–] 13 points 2 months ago (3 children)

    A useful idiot still needs to be able to do things for you, win over the right people, set the tone of the room, be the distraction. If the useful idiot goes off of the rails, stops being taken seriously at all, you're left with just an idiot. They're worried they lost the useful part

  • source
  • parent
  • context
  • view more: next ›