l'errore è nel ciclo for perchè stai facendo un getElementById su un numero (e non si può assegnare un numero come id.

quindi dai un id corretto alle tue checkbox e usa questo codice

codice:
           inputs = document.getElementsByTagName('input');
            
            for (i=0; i<inputs.length; i++) {
                if (inputs[i].type == 'checkbox') {
                    if(inputs[i].checked) {
                        testo += inputs[i].value;
                    }
                }
            }