WCAG 2.0 compliance: do I have to support browsers which don’t support JavaScript?

WCAG 2.0 has some requirements on robustness: “Content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies”, but it doesn’t mention JavaScript explicitly.

Now I have a project where I have to meet WCAG 2.0 recommendations. Do I have to support browsers / user agents which don’t support JavaScript?

How do I write unit tests for legacy code (that I don’t understand)?


Forward

I’ve read a lot of things before asking this question, including many relevant questions right here on SE:

  • (Software Engineering SE) Writing tests for code whose purpose I don’t understand
  • (Software Engineering SE) Unit testing newbie team needs to unit test
  • (Software Engineering SE) Best practices for retrofitting legacy code with automated tests
  • (Software Engineering SE) How to unit test large legacy systems?
  • (Blog post) How to mock up your Unit Test environment

However, I can’t help but feel that the itch hasn’t been scratched yet after reading for help.


TL;DR

How do I write unit tests for legacy code that I can’t run, simulate, read about, or easily understand? What regression tests are useful to a component that presumably works as intended?


The Whole Picture

I’m a returning summer intern again as I’m transitioning into grad school. My tasking involves these requirements:

  1. For a particular product, evaluate whether our software team can upgrade their IDE and JUnit version without losing compatibility with their existing projects.
  2. Develop unit tests for some component in the existing Java code (it’s largely not Java). We want to convince the software team that unit testing and TDD are invaluable tools that they should be using. (There’s currently 0% code coverage.)
  3. Somehow, end the days of cowboy coding for a critical system.

After obtaining a copy of the source code, I tried to build and run it, so that I might understand what this product does and how it works. I couldn’t. I asked my supervisors how I do, and I was issued a new standalone machine capable of building it, including the build scripts that actually do. That didn’t work either because as they should’ve expected, their production code only runs on the embedded system it’s designed for. However, they have a simulator for this purpose, so they obtained the simulator and put it on this machine for me. The simulator didn’t work either. Instead, I finally received a printout of a GUI for a particular screen. They also don’t have code comments anywhere within the 700,000+ Java LOC, making it even harder to grasp. Furthermore, there were issues evaluating whether or not their projects were compatible with newer IDEs. Particularly, their code didn’t load properly into the very IDE version they use.

My inventory is looking like this:

  • NetBeans 8, 9, 10, 11
  • JUnit 4, 5
  • Their source code for a particular product (includes 700,000+ Java LOC)
  • Virtually no code comments (occasionally a signature)
  • No existing tests
  • A physical photo of a GUI window
  • A software design document (109 p.) that doesn’t discuss the component in the picture

I at least have enough to theoretically write tests that can execute. So, I tried a basic unit test on this said component. However, I couldn’t initialize the objects that it had as dependencies, which included models, managers, and DB connections. I don’t have much JUnit experience beyond basic unit testing, so follow me to the next section.


What I’ve Learned From My Reading

  1. Mocking: If I write a unit test, it likely needs to have mock variables for production dependencies that I can’t easily initialize in setUp.
  2. Everyone here liberally suggests the book “Working Effectively with Legacy Code” by Michael Feathers.
  3. Regression tests are probably a good place to start. I don’t think I have enough weaponry to attempt integration testing, and regression tests would provide more instant gratification to our software team. However, I don’t have access to their known bugs; but, I could possibly ask.

And now an attempt to articulate the uncertainty I still have as a question. Essentially, I don’t understand the how part of writing these tests. Assuming I don’t receive any further guidance from my supervisors (likely), it’s in my ballpark to not only learn what this component does but to decide what tests are actually useful as regression tests.

As professionals who’ve worked with projects like this longer than I have, can you offer any guidance on how to write unit tests in this kind of situation?

Why can’t mages just enchant armour to have no spell failure or have a light weight enchantment aka why mages don’t wear armour? [on hold]

I know many have asked this question but I have to ask as I’m still not satisfied with the answers.

Most arguments used against mages wearing armour

  1. Iron repels magic

    • That is untrue, why? The evidence lies in enchanted/magic armour and weapons thus proving that metal/iron don’t necessarily repel magic.
    • Furthermore, if magic truly repels magic then magic will do nothing against armour wearing knights but in most rpg magic can bypass armour.
    • In myth, magic/enchanted weapons such as Excalibur existed thus proving that iron does not repel magic.
  2. Armour restricts mobility in casting or is too heavy for mages

    • That is incorrect, why?. Armour is not as heavy as one might think, the weight of the armour is distributed across the body thus being not as heavy as you think. Furthermore, armour is lighter than a firefighter suit. Armour is also articulated properly to allow for mobility. Gauntlet is not armoured below the hand as well as have and have more mobility that one might think and if they did affect casting then you can just not wear the gauntlet.

    Examples in videos: https://www.youtube.com/watch?v=qzTwBQniLSc https://www.youtube.com/watch?v=pAzI1UvlQqw

    • As mentioned in the question if armour is truly that heavy in rpg world than why don’t you just use a weight removal, weight reduction or lightweight enchantment on the armour.
  3. Armour causes spell failure cause that is how it works

    • Then as mentioned in the question why not use enchantment to negate that problem.
    • Then why can paladin, cleric, druids, bards and arcane archer use magic in armour without spell failure.
  4. There is no reason for mages to use armour cause they don’t need them.

    • That is wrong, why? Anti-magic or dispel, silence etc.
  5. Armour conducts electricity and can electrocute the user or will travel go to the armour.

    • Wrong, why? Mages can shape their magic and they can control them so likewise they can control the electricity to not go to the armour. For example ball lightning, fire ball, lightning bolts etc proving that mages can manipulate magic. Furthermore, electric magic does not follow physics cause if they did electric magic would not work properly as air is a bad conductor of electricity and the only reason lightning works is due to the electrical discharge caused by imbalances between storm clouds and the ground. If you try to generate electricity it will arc uncontrollably.
    • Faraday cage principle will protect user from electricity.
    • If electric magic is truly a problem which I don’t think so then just enchant the armour to be not conductive or don’t use electric magic.
  6. Armour prevents hearing and chanting magic properly.

    • Make holes to allow for better hearing and speaking.
    • Wear more open helmets or open visor.
    • Use enchantment
    • Paladin/Clerics etc don’t have that problem despite wearing a helmet.
    • Hoods inhibit hearing yet mages wear them.
  7. It is unbalanced.

    • Not really paladin, cleric, druids and shamans are strong hybrids with armour and yet they are not considered unbalanced.

Why does Firefox keep offering “unreputable” add-ons and add-ons that they don’t even review?

When I install an add-on to Firefox, choosing it from the ones I find by using the Tools / Add-ons menu, sometimes after a few days Avast pops up a warning that the add-on is “unreputable” and strongly recommends and offers to remove it.

Of course malicious add-ons could potentially steal my passwords, intercept anything I type in that browser and do horrible things in general, so when I see such warnings I don’t think twice and I just remove the add-on, but it’s becoming too frequent and annoying, and it surprises me a lot that apparently Avast knows so much better than Mozilla about unreputable Firefox add-ons.

If Avast discovers malice in an add-on and lets the world know and even offers to remove it, why at the same time Mozilla happily keeps offering the add-on for long time? I had some that Avast recommended me to remove many months ago and are still offered in FF. Mozilla might even offer add-ons that were never checked at all, see this answer, but how is that possible if add-ons are potentially so dangerous? I’m also curious about how common successful attacks via FF add-ons are.

Also because if it’s so common that FF add-ons that keep being offered in FF are unreputable, I would have a good deal of worrying to do for the past, because I kept “unreputable” add-ons installed for a while before Avast found them.

Why Google Search Console coverage reports show excluded pages that don’t exist at all

My new website is only about a month old and it has only 27 different web pages. I submitted sitemap.xml to the Google Search Console and it successfully indexed all my pages. However, in the Coverage page apart from my valid urls I can also see 9.000 other Excluded urls and 21 Issues. When I open the details I see thousands of urls which don’t exist on my website at all! enter image description here

Here are some example links which don’t exist on my website but are reported: enter image description here Now comes the wierdest part, if I search for some of this urls on Google, for example "/телото-на-ленин-ќе-се-освежи-и-ќе-добие" I can clearly see that this is a url hosted by another website. While searching for these urls I found that all this urls are actually some older links from other famous Macedonian media websites. And it is not only one website but multiple different existing websites. This is very confusing to me. My website domain is https://www.vinozito.mk/

With the Pixel 2 supporting USB Audio Class 1/2/3, which USB audio devices work? Or *don’t* work?

https://productforums.google.com/forum/#!topic/phone-by-google/Yvy0RfOPFfU

Pixel 2 supports audio adapters and headsets that communicate digitally over USB-C as defined by USB Audio Class 1/2/3. Pixel 2 does not support an analog audio signal over USB-C and subsequently will display an unsupported notification warning when an analog audio device is attached.

Here’s the spec documents from USB.org:

http://www.usb.org/developers/docs/devclass_docs/

So it got me thinking, what kinds of USB audio devices are actually supported?

  • Audio mixers, like this one from Behringer? Or does it only support USB output, not input? I have such a mixer, but I don’t have a Pixel 2 to test.

  • Car stereos, to my knowledge, have never supported any USB Audio Device class. I hope this changes, but all I’ve seen is support for USB mass storage mode (only old versions of Android), then MTP (only plays formats that the car stereo supports; no FLAC, maybe no AAC), and then AOA v2, which seems to have been abandoned for some reason (Pixel 2 doesn’t support it, nor does the Moto X4).

  • USB headphones: some recommended models are listed on the Google post I linked above. Are there any that you’ve found not to work?

  • USB DACs/amps: here’s a thread, they seem to be well supported.

  • Speaker docks: they only support iPhones, don’t they? Has any manufacturer chosen to make one for the Pixel 2, or are there any that support a class of USB Audio?